top of page
Writer's pictureThe Tech Platform

CSS :hover Selector ( Select and style unvisited, visited, hover, and active links:)


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

0 comments

Recent Posts

See All

Comments


bottom of page