W3C home > Mailing lists > Public > www-style@w3.org > June 2001

Specificity with id selectors

From: Eric Costello <eric@schwa.com>
Date: Fri, 15 Jun 2001 13:05:06 -0500
To: <www-style@w3.org>
Consider the following selectors:




It is my understanding that by the rules of specificity, the former rule can
be said to have greater specificity. Is that correct, even though there
cannot legally exist more than one element with the same id attribute?

In my tests, browsers ignore a rule with the #myID selector if a rule for
div#myID also exists anywhere in the document.


P.S. Thanks to everyone who responded to my off-topic question regarding
important declarations. For those of you that were worried, I'm not trying
to usurp user style sheets! I'm working on a book and just wanted to get my
facts straight.
Received on Friday, 15 June 2001 14:07:39 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:26:58 UTC