W3C home > Mailing lists > Public > www-style@w3.org > December 2011

Re: "." in class selectors where class names have special characters

From: Simon Sapin <simon.sapin@kozea.fr>
Date: Wed, 28 Dec 2011 08:17:56 +0100
Message-ID: <4EFAC2A4.4060500@kozea.fr>
To: www-style@w3.org
Le 27/12/2011 22:43, Peng Yu a écrit :
> Hi,
> http://www.w3.org/TR/CSS2
> The above document doesn't explain what characters are allowed when
> "." is used as the class selectors. For example,
> <div class="100.100"></div>
> Selecting the above element by div.100.100 seems not to work.
> Do I miss anything in the document? Or this is discussed in some other
> document that I'm not aware of.


As answered before, the class name in CSS is an "identifier", as 
described here:


Everything that can not be literally used in an identifier can be 
escaped with "\" + hexadecimal code. See the above link for the details 
of the escaping syntax.

More reading (also about HTML and JavaScript), a demo, and a tool to try 
your ownn values:


Simon Sapin
Received on Wednesday, 28 December 2011 07:18:31 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:08 UTC