[thelist] Rules for valid css class names

Garrick S. Bodine (Shan) gsb at athenswebdevelopment.com
Thu Mar 10 13:28:17 CST 2005


On Thu, 2005-03-10 at 13:59 -0500, Dave Merrill wrote:
> Can anyone point me to the rules for what constitutes a legal css class
> name? The Class Selectors section of the w3 css21 spec doesn't say.

Quote from http://www.w3c.org/TR/CSS21/grammar.html :

"In CSS1, a class name could start with a digit (".55ft"), unless it was
a dimension (".55in"). In CSS2, such classes are parsed as unknown
dimensions (to allow for future additions of new units). To make ".55ft"
a valid class, CSS2 requires the first digit to be escaped (".\35 5ft")"

HTH,
gsb



More information about the thelist mailing list