W3C home > Mailing lists > Public > www-style@w3.org > October 2003

Re: [CSS21] colons are forbidden in type selectors

From: Ian Hickson <ian@hixie.ch>
Date: Sat, 18 Oct 2003 17:41:35 +0000 (UTC)
To: Elliotte Rusty Harold <elharo@metalab.unc.edu>
Cc: "www-style@w3.org" <www-style@w3.org>
Message-ID: <Pine.LNX.4.58.0310181737350.20580@dhalsim.dreamhost.com>

On Sat, 18 Oct 2003, Elliotte Rusty Harold wrote:
> This rules out the colon character which is widely used in XML names.
> It is not possible given this to write a simple rule such as
> pre:name { font-weight: bold}

In non-namespace-aware browsers, you would do:

   pre\:name { font-weight: bold; }

However, this is very poor semantically, as it gives special meaning to
the namespace prefix.

Instead you should use CSS3 Selectors, that are supported by basically all
the namespace-aware XML+CSS browsers:

   @namespace foo url(http://example.net/pre);
   foo|name { font-weight: bold; }

See: http://www.w3.org/TR/css3-selectors/#typenmsp

Note that the ':' character in CSS has special meaning. The following:

   pre:name { font-weight: bold; }

...would mean "pre elements that match the pseudo-class :name should be

Ian Hickson                                      )\._.,--....,'``.    fL
U+1047E                                         /,   _.. \   _\  ;`._ ,.
http://index.hixie.ch/                         `._.-(,_..'--(,_..'`-.;.'
Received on Saturday, 18 October 2003 13:42:11 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:24 GMT