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

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.

Hi,

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

http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier

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:

http://mathiasbynens.be/notes/html5-id-class
http://mathiasbynens.be/demo/crazy-class
http://mothereff.in/css-escapes

Regards,
-- 
Simon Sapin

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