CSS Links

Please Share On:

Definition:

CSS links indicate that the blue color text has a link that opens another page upon clicking on it. The link text can be styled in different states such as:

  1. link – normal, unvisited link
  2. visited – already visited the link
  3. hover – link on mouse over it
  4. active – a link that is just clicked

Source Code:

<!DOCTYPE html>
<html>
<head>
<style>

.css-links:link {
  color: blue; /*unvisited link*/
}

.css-links:visited {
  color: green; /*visited link*/
}

.css-links:hover {
  color: red; /*mouse over link*/
}

.css-links:active {
  color: orange; /*selected link*/
}
</style>
</head>

<body>
<p><b><a class = "css-links" href="https://www.elsebazaar.com/blog/css-tutorial/" target="_blank">Put your mouse over to check on different link states</a></b>
</body>
</html>

Output:

Put your mouse over to check on different link states

Output Sample

unvisited link
visited link
mouse over it
selected link


Leave a Reply

Your email address will not be published. Required fields are marked *

Copyright @2023. All Right Reserved.


Social media & sharing icons powered by UltimatelySocial