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

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

I should note that in this case you could just rewrite the latter as "div" and 
get the same effect.  Or use !important.

I'm not saying Gecko's behavior here is obviously correct (though again the spec 
is unclear, and I've requested a clarification before making code changes).  I'm 
just saying there are no really good use cases for this particular use of this 
particular selector.  Heck, you could get an identical specificity effect with:

  div[id], div:not([id])

or with

  div:not([never-set-attribute])

or with any of a slew of other selectors.

-Boris

Received on Tuesday, 19 February 2008 01:47:46 UTC