[thelist] Rules for CSS Style Names

Hardacker, Andrew Andrew.Hardacker at Compuware.com
Fri Mar 15 11:19:01 CST 2002

Yes, James, you're right. I vaguely recall the amendment but I more clearly
remember going through hell with this in Netscape 6.0, which I was required
to support. We discovered that banning the underscores eliminated our
problems. Even where permitted, some implementations seemed to simply ignore
characters after the first underscore. So the "heading_red" and
"heading_blue" were not invalid but were seen as just "heading". And general
hilarity ensued.

Thanks for the refresher.

> "In CSS2, identifiers  (including element names, classes, and IDs in
> selectors) can contain only the characters [A-Za-z0-9] and ISO 10646
> characters 161 and higher, plus the hyphen (-); they cannot start with a
> hyphen or a digit."
> http://www.w3.org/TR/REC-CSS2/syndata.html#q4

    True, except that this was amended in the CSS 2 errata document last
year to include underscores [1].
1. http://www.w3.org/Style/css2-updates/REC-CSS2-19980512-errata.html#x3
2. http://developer.netscape.com/evangelism/docs/technotes/css-underscores/

Andy Hardacker

The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it.

More information about the thelist mailing list