Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Special characters in CSS selectors [closed]

What characters can be used as CSS identifiers in a CSS file?

How can special characters be escaped (to avoid conflicts)?

like image 621
Ozgur Avatar asked Nov 09 '10 10:11

Ozgur


1 Answers

In CSS, identifiers (including element names, classes, and IDs in selectors) can contain only the characters [a-zA-Z0-9] and ISO 10646 characters U+00A1 and higher, plus the hyphen (-) and the underscore (_); they cannot start with a digit, or a hyphen followed by a digit. Identifiers can also contain escaped characters and any ISO 10646 character as a numeric code (see next item).code (see next item).

http://www.w3.org/TR/CSS21/syndata.html#characters

like image 184
mamoo Avatar answered Oct 06 '22 00:10

mamoo