CSS <ident> Data Type
The <ident> data type is an unquoted identifier, read as a single word. It is the general form behind CSS keywords and author-chosen names.
Description
The <ident> CSS data type represents an identifier: a sequence of characters that is not quoted and is read as a single word. It is the most general form of name in CSS, and the building block for keywords such as auto and block, property names, and author-defined names. The more specific types <custom-ident> (names you choose, such as animation names) and <dashed-ident> (names starting with two dashes) are both kinds of <ident>.
An identifier can contain the letters a to z and A to Z, the digits 0 to 9, hyphens (-), underscores (_) and any non-ASCII character. It must not start with a digit, or with a hyphen followed by a digit. Any other character, including spaces and punctuation, can be included by escaping it with a backslash, either directly (\.) or as a hexadecimal code point (\2E ).
Whether an identifier is case-sensitive depends on where it is used: CSS keywords are case-insensitive (AUTO and auto mean the same), while author-defined names such as animation and counter names are case-sensitive. Unlike a <string>, an identifier is never written in quotes.
Examples of valid and invalid identifiers:
/* Valid */
nono79
ground-level
-test
_internal
\31 23 /* escaped digit: "123" */
bili\.bob /* escaped period */
日本 /* non-ASCII characters */
/* Invalid */
34rem /* starts with a digit */
-12rad /* hyphen followed by a digit */
bili.bob /* unescaped period */
"name" /* quoted: this is a string */
Syntax
<ident> = [ -- | - ]? <name-start-character> <name-character>*
Values
- <ident>Letters (a-z, A-Z), digits (0-9), hyphens (-), underscores (_), non-ASCII characters and escaped characters. It must not begin with a digit, two hyphens followed by nothing, or a hyphen followed by a digit.
Example
Browser Support
The following information will show you the current browser support for the CSS ident data type. Hover over a browser icon to see the version that first introduced support for this CSS data type.
Desktop





Tablets & Mobile





