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  www. j a v a 2s  .  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>

Related Tutorials