At 22:02 -0400 6/27/13, Chris Williams wrote:
Show me, with an example, a concrete difference in the behavior.
Well, since you asked so nicely.
<div><a href="urlgoeshere">Link</a></div>
In CSS terms, the user agent applies a style of 'a:link {color:
blue;}'. (Where 'blue' really means $USER_PREFERENCE but CSS doesn't
have variables. Yet. We'll stick with blue since that's the most
common $USER_PREFERENCE.) This overrides whatever color it might
otherwise have inherited from its parent element, which in this very
specific is probably an inherited value that traces back to another
user agent rule.
Now, I can explicitly write:
div {color: red;}
...and the link will continue to be blue. That's because the
inherited value of 'red' has no specificity-- again, not zero, but
none at all-- and is overridden by the user agent's assigned color of
'blue', which does carry specificity.
Then again, I can write:
* {color: red;}
...and the link will be red, despite the specificity of the universal
selector being zero, not none. That's because the color value is
directly assigned by the author, and author styles beat user agent
styles even when the author style has a lower specificity. (Assuming
they are both of normal weight, anyway. If not, things get a touch
ambiguous under CSS2 and a touch funky under the latest draft of the
relevant CSS3 module.)
--
Eric A. Meyer (http://meyerweb.com/eric/), List Chaperone
"CSS is much too interesting and elegant to be not taken seriously."
-- Martina Kosloff (http://mako4css.com/)
______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/