HTML CSS examples for CSS Selector:link
The :link selector selects unvisited links.
Use the :visited selector to style links to visited pages.
Use the :hover selector to style links when you mouse is over them.
Use the :active selector to style links when you click on them.
Select and style unvisited, visited, hover, and active links:
<!DOCTYPE html> <html> <head> <style> /* unvisited link */ a:link { color: green; } /* visited link */ a:visited {<!-- w ww . java 2 s. c om--> color: green; } /* mouse over link */ a:hover { color: red; } /* selected link */ a:active { color: yellow; } </style> </head> <body> <p>Mouse over and click the link: <a href="https://www.java2s.com">java2s.com</a></p> </body> </html>