CSS :hover Selector ( Select and style unvisited, visited, hover, and active links:)
- The Tech Platform
- May 30, 2021
- 1 min read
Below is the example of the CSS :hover Selector (visited, hover and selected links)
Code:
<!DOCTYPE html>
<html>
<head>
<style>
/* unvisited link */
a:link {
color: green;
}
/* visited link */
a:visited {
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.thetechplatform.com">The Tech Platform</a></p>
</body>
</html>
Output:

When you will click the link you will see the below result.

Source: W3School
The Tech Platform
Comments