Sent by Eric A. Meyer on 28 August 2004 20:08
At 20:36 +0200 8/28/04, Bjoern Hoehrmann wrote:
>* Eric A. Meyer wrote:
>> I'm answering this because it's already (sort of) happened, and
>>because it does have some practical impact. In CSS1, class and ID
>>names could not start with digits or contain underscore characters.
>>In CSS2, digits were okay, but underscores weren't.
>
><http://www.w3.org/TR/1998/REC-CSS2-19980512/grammar.html>,
>
>[...]
> class : '.' IDENT;
>[...]
> ident {nmstart}{nmchar}*
>[...]
> nmstart [a-z]|{nonascii}|{escape}
>[...]
>
>IOW, digits ([0-9]) may not start an identifier and may thus not start
>the identifier in a class selector, you need to escape them in both CSS1
>and CSS2. New document types usually do not allow to specify class names
>that start with a [0-9] digit either, XHTML 1.1 and SVG 1.2 for example,
>so this should not really be an issue.
Whoops, quite right; for some reason I keep thinking that
unescaped leading digits were made legal when they weren't. Sorry
for the misinformation!
Underscores were added in the errata, so that part of my post is
still accurate; see <http://www.w3.org/TR/CSS21/grammar.html>...
which I think also says you can't start a class name with an
uppercase letter, either! On the other hand, it does appear from my
untutored reading of the file that you can start an ID name with a
digit, any case letter, or an underscore. Am I wrong?
--
Eric A. Meyer (http://www.meyerweb.com/eric/), List Chaperone
"CSS is much too interesting and elegant to be not taken seriously."
-- Martina Kosloff (http://www.mako4css.com/)
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/