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

Re: [css3] "Selectors that People Actually Use"

From: fantasai <fantasai.lists@inkedblade.net>
Date: Mon, 18 Feb 2008 17:30:32 -0800
Message-ID: <47BA3138.8040006@inkedblade.net>
To: Alan Gresley <alan1@azzurum.com>
CC: Boris Zbarsky <bzbarsky@MIT.EDU>, Daniel Glazman <daniel.glazman@disruptive-innovations.com>, www-style@w3.org

Alan Gresley wrote:
> Boris Zbarsky wrote:
> 
>>> p[class*=""], p:not([class*=""]) {}
>> That's equivalent to the selector "p".
>>
>> -Boris
> 
> 
> Correct but which is of greater specificity?
> 
> 
> div {width: 100px;height:100px;background:red}
> div[id*=""], div:not([id*=""]) {background:blue}

The second selector has greater specificity.
(Probably it would be shorter to write
   div[id], div:not([id])
)

~fantasai
Received on Tuesday, 19 February 2008 01:30:35 GMT

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