:visited - HTML CSS CSS Selector

HTML CSS examples for CSS Selector:visited

Description

The :visited selector selects visited links.

Allowed styles are:

  • color
  • background-color
  • border-color
  • outline color
  • column-rule-color
  • the color parts of fill and stroke

Example

Select unvisited, visited, hover, and active links:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<style>
/* unvisited link */
a:link {
    color: green;
}

/* visited link */
a:visited {<!--  w w w.j a  v  a 2 s.  c  o m-->
    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>

Related Tutorials