[thelist] Rules for valid css class names

Dave Merrill dmerrill at usa.net
Thu Mar 10 14:33:22 CST 2005


Interesting. I don't see how the "55in" in
	<div class="55in">

...or in
	.55in {background: #fc0}

...could be interpreted as a dimension. What am I missing?

Useful info in any case, since it does seem to say that leading digits are
legal for css1 class names, but not for css2, but that you have to them
(didn't even know you *could* escape them) for css2.

Doesn't seem consistent with Ken's reference though. Odd.

Dave Merrill


> 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