Select and style a link when you mouse over it:
More "Try it Yourself" examples below.
The :hover selector is used to select elements when you mouse over them.
Tip: The :hover selector can be used on all elements, not only on links.
Note: :hover MUST come after :link and :visited (if they are 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: In IE there must be declared a <!DOCTYPE> for the :hover selector to work on other elements than the <a> element.
Select and style a <p>, <h1> and <a> element when you mouse over it:
Select and style unvisited, visited, hover, and active links:
Style links with different styles:
CSS tutorial: CSS Links
CSS tutorial: CSS Pseudo classes