Re: IDs *not* in selectors

Perhaps someone could explain what I am missing in trying to reconcile
this statement from Bert Bos, earlier in this thread:

>Since CSS1 allowed digits, I think we should change the text in 4.1.3
>to match the grammar (i.e., digits are allowed), rather than
>vice-versa.

with this comment from the CSS1 grammar (1):

/* There is a constraint on the id and solitary_id that the
   ** part after the "#" must be a valid HTML ID value;
   ** e.g., "#x77" is OK, but "#77" is not.  */
                         
Just as I think I almost get close to sort of understanding that,
initially at least, the intent of CSS1 was _not_ to allow initial
digits, an apparently conflicting assertion is made by the author of the
recommendation. It seems to me that the comment above reinforces the
text (2):

"in CSS1, selectors (element names, classes and IDs) can contain only 
the characters A-Z, 0-9, and Unicode characters 161-255, plus dash (-); 
they cannot start with a dash or a digit;..."

In short: I cannot find the specific part of the CSS1 recommendation
which allows digits as the initial character in class names/IDs . Please
give the reference for the statement, preferably with a direct quote
from the text of the CSS1 recommednation rather than a reference to the
CSS1 grammar.

As to Peter's comment:

"Amusingly enough, that would break parsing of colors, eg:
{ color: #123456; }"

It seems to me that this comment, from the CSS2 grammar (3):

"/*
       * There is a constraint on the color that it must
       * have either 3 or 6 hex-digits (i.e., [0-9a-fA-F])
       * after the "#"; e.g., "#000" is OK, but "#abcd" is not.
       */"

is intended to address that concern, analogously to the way the first
comment I quoted from CSS1 is meant to address this 'digit as initial
character' concern.

Though I'm always glad to provide amusement, that is not the purpose of
any of the posts I've made on this topic. 


(1) http://www.w3.org/TR/REC-CSS1#appendix-b
(2) http://www.w3.org/TR/REC-CSS1#forward-compatible-parsing
(3) http://www.w3.org/TR/REC-CSS2/grammar.html#q1

Received on Sunday, 11 July 1999 14:20:06 UTC