Select and style the active link:
More "Try it Yourself" examples below.
The :active selector is used to select and style the active link.
A link becomes active when you click on it.
Tip: The :active selector can be used on all elements, not only links.
Note: :active MUST come after :hover (if present) in the CSS definition in order to be effective!
The numbers in the table specifies the first browser version that fully supports the selector.
Note: IE8 and newer versions support the :active selector on all elements. IE7 only supports the :active selector on links.
Select and style a <p>, <h1> and <a> element when you click on it:
Select and style unvisited, visited, hover, and active links:
Style links with different styles:
CSS tutorial: CSS Links
CSS tutorial: CSS Pseudo classes