W3C CSS logo Cascading Style Sheets FAQ

home CSS FAQ parent common mistakes

6.2. What does `\ABCD' mean (and `\ABCDE')?

CSS allows Unicode characters to be entered by number. For example, if a CLASS value in some Russian document contains Cyrillic letters `EL' `PE' (Unicode numbers 041B and 041F) and you want to write a style rule for that class, you can put that letter into the style sheet by writing

.\041B\041F {font-style: italic }

This works on all keyboards, so you don't need a Cyrillic keyboard to write CLASS names in Russian or another language that uses that script.

The digits and letters after the backslash (\) are a hexadecimal number. Hexadecimal numbers are made from ordinary digits and the letters A to F (or a to f). Unicode numbers consist of four such digits.

If the number starts with a `0', you may omit it. The above could also be written as

.\41B\41F { font-style: italic }

But be careful if the next letter after the three digits is also a digit or a letter a to f! This is OK: .\41B-\41F, since the dash (-) cannot be mistaken for a hexadecimal digit, but .\41B9\41F is only two letters, not three.

Four digits is the maximum, however, so if you write

.\041B9\041F { font-style: italic }

that's three letters: two Cyrillic ones with a `9' in between.

Unicode numbers can be found in the Unicode book: The Unicode Standard version 2.0, Addison Wesley Developers Press, Reading, Massachusets, 1996, ISBN 0-201-48345-9.


W3C Bert Bos
Webmaster
Last updated 10 Jan 1997