CSS :link Selector
ExampleHow to style links (<a> elements with an href):
Try it yourself » |
Definition and Usage
The :link selector styles unvisited links.
Note: The :link selector does not style links to pages you have already visit.
Tip: Use the :visited selector to style links to visited pages.
Tip: Use the :hover selector to style links when you mouse over them.
Note: :hover MUST come after :link and :visited (if they are specified) in the CSS definition in order to be effective!
Tip: Use the :active selector to style links when you click on them.
Note: :active MUST come after :hover (if specified) in the CSS definition in order to be effective!
Browser Support
The :link selector is supported in all major browsers.
CSS Version
The :link selector was first introduced in:
CSS 1
Related Pages
CSS tutorial: CSS Links
CSS tutorial: CSS Pseudo classes
Try it Yourself - Examples |
ExampleHow to style a link, unvisited, visited, active, and when you mouse it:
Try it yourself » |
ExampleHow to give different links different styles:
Try it yourself » |
Complete CSS Reference