ident
Quick Summary for <ident>
Code Usage for <ident>
nono79 A mix of alphanumeric characters and numbers ground-level A mix of alphanumeric characters and a dash -test A dash followed by alphanumeric characters --toto A custom-property like identifier _internal An underscore followed by alphanumeric characters \22 toto A Unicode character followed by a sequence of alphanumeric characters bili\.bob A correctly escaped period
More Details for <ident>
ident
The <ident>
CSS data type denotes an arbitrary string used as an identifier.
Syntax
The syntax of <custom-ident>
is similar to CSS identifiers (such as property names), except that it is case-sensitive. It consists of one or more characters, where characters can be any of the following:
A
to Z
, or a
to z
), any decimal digit (0
to 9
), a hyphen (-
), an underscore (_
), an escaped character (preceded by a backslash, \
), a Unicode character (in the format of a backslash, \
, followed by one to six hexadecimal digits, representing its Unicode code point) Note that id1
, Id1
, iD1
and ID1
are all different identifiers as they are case-sensitive. On the other hand, as there are several ways to escape a character, toto\?
and toto\3F
are the same identifiers.
Examples
Valid identifiers
nono79 A mix of alphanumeric characters and numbers ground-level A mix of alphanumeric characters and a dash -test A dash followed by alphanumeric characters --toto A custom-property like identifier _internal An underscore followed by alphanumeric characters \22 toto A Unicode character followed by a sequence of alphanumeric characters bili\.bob A correctly escaped period
Invalid identifiers
34rem It must not start with a decimal digit. -12rad It must not start with a dash followed by a decimal digit. bili.bob Only alphanumeric characters, _, and - needn't be escaped. 'bilibob' This would be a<string>
. "bilibob" This would be a<string>
.
Specifications
Specification | Status | Comment |
---|---|---|
CSS Values and Units Module Level 4The definition of '<ident> ' in that specification. | Editor's Draft | |
CSS Values and Units Module Level 3The definition of '<ident> ' in that specification. | Candidate Recommendation |
As this type is not a real type but a convenience type used to simplify the definition of other CSS syntax.
See also
<custom-ident>
– A restricted subset of <ident>
values excluding CSS-wide keywords, custom properties
and other per-property values. Last modified: Jan 25, 2022, by MDN contributors
Select your preferred language English (US)日本語 Change language Posted in
12:22 am, February 22, 2022
Add Comment
Other Items in CSS
rgb()
rgba()
:right
right
@right-bottom
:root
rotate
rotate()
rotate3d()
rotateX()
rotateY()
rotateZ()
row-gap
ruby-align
ruby-position
saturate()
scale
scale()
scale3d()
scaleX()
scaleY()
scaleZ()
:scope
scroll-behavior
scroll-margin
scroll-margin-block
scroll-margin-block-end
scroll-margin-block-start
scroll-margin-bottom
scroll-margin-inline
scroll-margin-inline-end
scroll-margin-inline-start
scroll-margin-left
scroll-margin-right
scroll-margin-top
scroll-padding
scroll-padding-block
scroll-padding-block-end
scroll-padding-block-start
scroll-padding-bottom
scroll-padding-inline
scroll-padding-inline-end
scroll-padding-inline-start
scroll-padding-left
scroll-padding-right
scroll-padding-top
scroll-snap-align
scroll-snap-stop
scroll-snap-type
@scroll-timeline