Re: IDs *not* in selectors

Sue Sims wrote:

> From: http://www.w3.org/TR/REC-CSS2/syndata.html#q4
>
> "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...."
>
> So we may infer that #123myid is perfectly legal whilst P#123myid is
> not?

No, if you look at appendix D, '#123myid' is a single HASH token, which is
defined as a '#' followed immediately by a NAME token, which can start with
[A-Za-z0-9-]|{nonascii}|{escape}.

The restriction to not start with digits or '-' is limited only to IDENT
tokens (And you can always escape them (or anything for that matter) into
the start of one of those).

The text in section 4.1.3 needs clarification.

Peter

> If that was the intent, may I request a synthesis of the
> rationale?
> --
> Sue Sims

Received on Thursday, 8 July 1999 13:11:04 UTC