W3C home > Mailing lists > Public > www-style@w3.org > April 2009

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

From: Aryeh Gregor <Simetrical+w3c@gmail.com>
Date: Tue, 21 Apr 2009 20:38:05 -0400
Message-ID: <7c2a12e20904211738j75bc9d64yd7471e81e9c5f122@mail.gmail.com>
To: James Hopkins <james@idreamincode.co.uk>
Cc: Thomas Phinney <tphinney@cal.berkeley.edu>, "www-style@w3.org" <www-style@w3.org>
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
Received on Wednesday, 22 April 2009 00:38:41 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:35 UTC