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

Re: [css21] multiple ID attributes with the same value

From: Ian Hickson <ian@hixie.ch>
Date: Mon, 14 Feb 2005 12:42:01 +0000 (UTC)
To: Anne van Kesteren <fora@annevankesteren.nl>
Cc: W3C CSS List <www-style@w3.org>
Message-ID: <Pine.LNX.4.61.0502141240300.11485@dhalsim.dreamhost.com>

On Mon, 14 Feb 2005, Anne van Kesteren wrote:
> 
> Ian Hickson wrote:
> > On Sun, 13 Feb 2005, Anne van Kesteren wrote:
> > > Would it be possible that CSS 2.1 specifies something similar to
> > > XPath 1.0[1]? Something in the lines of: "When multiple ID
> > > attributes with the same attribute value are found only the first
> > > should be considered significant."
> > 
> > What does that mean?
> 
> That in a document such as:
> 
>  <foo>
>   <bar xml:id="xyz"/>
>   <bar xml:id="xyz"/>
>  </foo>
> 
> ... with the following style rule applied:
> 
>  bar{ background:lime }
>  #xyz{ background:red }
>  bar#xyz:first-child{ background:lime }
> 
> ... there is no red.

Oh, I see. IMHO that would be bad, and is not what is implemented either.

Both elements have the ID "xyz", so both should match "#xyz".

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Monday, 14 February 2005 12:42:07 GMT

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