Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Create custom clicked-link outlines in Safari' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Create custom clicked-link outlines in Safari
Authored by: sfn on Feb 18, '04 06:25:22PM
Doesn't the page's css always win? I have always used:
a  { color: #003366; text-decoration: none }
to turn off underlining in Safari but it won't override a pages css of a link's text-decoration. I don't quite understand the addition of
!important
here either.

---
-sfn

[ Reply to This | # ]

Cascading Order in CSS
Authored by: nicksay on Feb 18, '04 11:26:56PM

According to the W3C CSS Specification, style sheets may have three different origins: author (i.e. the page), user (i.e. you), and user agent (i.e. Safari). Obviously, styles defined in these three scopes may overlap. The CSS cascade assigns each rule a "weight", and when several rules apply, the one with the greatest "weight" takes precedence.

By default, author-defined rules have precedence over user-defined rules. The user agent-defined rules always have the least "weight" of all. Since, this cascade strategy gives the author's style sheets higher weight than the user's, the W3C recommends that the user agent provide the ability to "turn off" certain style sheets (e.g. through a pull-down menu).

However, to create a balance of power between author and user within CSS itself, the !important declaration reverses the precedence chain. Both author- and user-defined rules may contain the !important declaration, and user !important rules override author !important rules.

Therefore, by using the !important declaration in one's user-defined style sheet (i.e. the one specified in the "Advanced" tab of Safari's preferences), one ensures that those rules are applied instead of any author-defined ones.



[ Reply to This | # ]
Cascading Order in CSS
Authored by: sfn on Feb 19, '04 08:32:00AM

Thanks, I glanced at the CSS1 docs and left it a that.

-s

---
-sfn



[ Reply to This | # ]