Created
July 27, 2011 22:53
-
-
Save mhulse/1110544 to your computer and use it in GitHub Desktop.
CSS a:link examples...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| ** | |
| ** Notice: Links must follow this order: | |
| ** | |
| ** a (a:link) | |
| ** a:visited | |
| ** a:visited:hover | |
| ** a:focus | |
| ** a:focus:hover | |
| ** a:hover | |
| ** a:active | |
| ** | |
| ** Note: If you are already targeting "a", "a:link" becomes superfluous. | |
| ** | |
| */ | |
| /* Set font-size and family on the body tag: */ | |
| body { font: 13px/1.231 arial, helvetica, clean, sans-serif; } /* YUI style... */ | |
| /* ... stuff here ... */ | |
| /* Here, the "a" inherits the font-size and family set via body tag above: */ | |
| a { | |
| color: #c00; | |
| text-decoration: none; | |
| } | |
| a:visited { color: #c00; } | |
| a:visited:hover, | |
| a:focus, | |
| a:focus:hover, | |
| a:hover, | |
| a:active { | |
| color: #f00; | |
| text-decoration: underline; | |
| } | |
| /* This would apply specifically to an element with the class of "nav" with "a" as children: */ | |
| .nav a {} | |
| .nav a:visited {} | |
| .nav a:visited:hover, | |
| .nav a:focus, | |
| .nav a:focus:hover, | |
| .nav a:hover, | |
| .nav a:active {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment