Select and style unvisited, visited, hover, and active links: - HTML CSS CSS Selector

HTML CSS examples for CSS Selector:active

Description

Select and style 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 {<!--from   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.book2s.com">book2s.com</a></p>

</body>
</html>

Related Tutorials