CSS :active Selector
ExampleHow to style active links:
Try it yourself » |
Definition and Usage
The :active selector styles links to active pages.
A link becomes active when you click on it.
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!
Note: :active MUST come after :hover (if specified) in the CSS definition in order to be effective!
Browser Support
The :active selector is supported in all major browsers.
CSS Version
The :active 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