Back

how to style an Anchor tag in an active, visited, link and hover state.

This piece of code shows how you can style your anchor tag in four different states.

<!DOCTYPE html>
<html>
<head>
<style>
a:link {
color: green;
background-color: transparent;
text-decoration: none;
}
a:visited {
color: pink;
background-color: transparent;
text-decoration: none;
}
a:hover {
color: red;
background-color: transparent;
text-decoration: underline;
}
a:active {
color: yellow;
background-color: transparent;
text-decoration: underline;
}
</style>
</head>
<body>

<h2>Link Colors</h2>

<p>You can change the default colors of links</p>

<a href=”learnpod.com.ng” target=”_blank”>Go to Learnpod Home</a>

</body>
</html>

 

Leave A Reply

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