CSS link


Changing look of HTML links using CSS

    Syntax:
  • selector{
    text-decoration:none;
    }

    Types of links in CSS

  • a:link-defines general link.
  • a:visited-defines visited link.
  • a:hover-defines link property when mouse is pointed over it.
  • a:active-defines link when it is clicked.

Example:

<!DOCTYPE html>
<html>
<head>
<style>
a:link{
text-decoration:none;
background-color:green;
}
a:visited{
text-decoration:none;
background-color:yellow;
}
a:hover{
text-decoration:none;
background-color:red;
}
a:active{
text-decoration:none;
background-color:black;
}
</style>
<title>
CSS LINK
</title>
</head>
<body>
<a href="logo.jpg">Click ME</a>
</body>
</html>

Output: