2012-10-02 19:20, Jonathan N. Little wrote:
>>>>> b {color: red;}
[...]
> Anyway using what you have given me pseudo-classes for A element are
> "specificity" is more than the base "B" element selector.
No, this is not about specificity at all.
> Learn about specificity and how the cascade works:
There are probably less than three people in the world who really
understand it. But there are of course very different levels of ignorance.
> To to increase the specificity for your rule I would use a descendant
> selector rule:
>
> b a { color: red; }
This would set the color of certain <a> elements, and *that* is the
point, not specificity. The point is that b {color: red;} sets the color
of <b> elements, not any nested elements. If nested elements *inherit*
the color, that’s completely distinct from *specificity*. And <a>
elements with href do not inherit a color at all, since they have (as a
matter of reality, not as required by specs) color set on them in
browser style sheets.
The rule above would make *all* <a> elements nested inside <b> elements
red, unless overridden by other rules.
> b a:link, b a:visited { color: red; }
This would set the color as above but only if the <a> element has the
href value. It does not pay any attention to the specific attribute value.
And all this, when completed, would be worse than useless, since it
would break the vital distinction between visited and unvisited links
*and* it would set their color to red, which is generally a poor choice
and not associated intuitively with links (except perhaps in their
activated state).
--
Yucca,
http://www.cs.tut.fi/~jkorpela/