Re: [CSS21] 4.1.3 Characters and case: Number Sign (#) in identifiers

On Tue, Apr 21, 2009 at 7:19 PM, James Hopkins <james@idreamincode.co.uk> wrote:
> First of all, apologies. I was restricting my train of thought to the use of
> CSS specifically with HTML, where 'id="invalid identifier" would be invalid.

Note that identifiers in CSS aren't limited to HTML ids, even when the
CSS is being used for HTML.  HTML classes and element names are also
identifiers, and probably other things as well.  A class name
containing a character such as # would be valid in HTML5, at least,
IIRC.  So while #foo#bar isn't really a case to get concerned about --
it can't mean anything useful anyway -- .foo.bar had better mean class
"foo" plus class "bar" ("foo" and "bar" being CSS identifiers) rather
than class "foo.bar" ("foo.bar" being a single CSS identifier).  Thus
the requirement that characters such as # and . be escaped in
identifiers.

Received on Wednesday, 22 April 2009 00:38:41 UTC