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

Re: : in CSS

From: Chris Lilley <chris@w3.org>
Date: Wed, 19 Feb 2003 13:45:44 +0100
Message-ID: <53170996750.20030219134544@w3.org>
To: www-style@w3.org, "Sigurd Lerstad" <sigler@bredband.no>

On Thursday, February 20, 2003, 9:54:28 AM, Sigurd wrote:

SL> Hello,

SL> When parsing CSS, how do you differentiate between elements which have a :
SL> in their name (like svg:svg) and pseudo elements/classes like (svg:link)

By noting that no elements have a colon in their name, it being

Assuming that the namespace prefix svg is declared to map to
http://www.w3.org/2000/svg then the qualified element name is the

local name = svg
namespace = http://www.w3.org/2000/svg

this would be used in a selector thus:

@namespace foo url(http://www.w3.org/2000/svg);

foo|svg { fill: purple }

Not that this will match all occurrences of the svg element in the SVG
namespace regardless of whether they use s:, svg: foobar: or nothing
as their prefix. It will not match elements that happen to be called
svg in some other namespace. Note that the choice of namespace prefix
in the CSS is arbitrary and is unaffected by the choice of prefix or
lack thereof in the file(s) that it is styling.

The alternative that people might have considered trying, svg\:svg is
bogus and harmful, because it pretends that the whole string is one
local name and because it makes assumptions about what the namespace
prefix is.

 Chris                            mailto:chris@w3.org
Received on Wednesday, 19 February 2003 07:47:05 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:06 UTC