W3C home > Mailing lists > Public > www-style@w3.org > July 2010

Specificity: nth-of-type versus attribute selector?

From: Estelle Weyl <estelle@weyl.org>
Date: Sun, 4 Jul 2010 00:50:21 -0700
Message-Id: <F1FFED7C-AECE-436C-8562-D866706CF18F@weyl.org>
To: "www-style@w3.org CSS" <www-style@w3.org>

is selecting every odd image in the document, then checking to see if  
the attribute has the word photo.
Is that correct according to the spec?

I tried many configurations, including img[src*=photos]:nth-of- 

No matter the source order, the first thing the browser selects is  
img:nth-of-type, before checking the attribute.

My assumption is that :nth-of-type, being a pseudo-class, has greater  
specificity than the attribute selector, but then shouldn't the :not  
pseudo have equal weight? I reversed the order, nothing seems to work.

The sandbox is here:


Don't see in the specifications what order should take precedence. I  
think this is something that may need to be clarified.

Received on Sunday, 4 July 2010 07:50:34 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:48 UTC