William Gill :
Quote:
Is this any clearer?
"If I use the selector #header, it will match an element of any type
that has been identified as "header", if one exists." |
Much clearer :-)
I was wondering if you were somehow trying to distinguish between
different types of elements with the same id attribute in the same
document. That would have been silly, of course, but I have seen worse
questions asked.
Anyway, as I understand the specs, div#x is more specific than #x, so it
wins in the rather unlikely case one would bother to write both.
Specifically :-), "#x" would have a specificity of a=0 b=1 c=0 d=0 ->
0,1,0,0 while "div#x" would have a specificity of a=0 b=1 c=0 d=1 ->
0,1,0,1 (
http://www.w3.org/TR/CSS21/cascade.html#specificity)
--
Johannes
"Quand on dit c'est un Johannes, cela vaut autant que ce que maintenant
on appelle un pédant" (H. Estienne, in É. Littré, /Dictionnaire de la
langue française/, art. PÉDANT)