Specificity: nth-of-type versus attribute selector?


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