CSS/HTML Change Link Background Color Code For Website - Learn About Website | DaddyFile

0

Background Color Explain

The background-color property can be used to specify a background color for links.


Html Code:

<!DOCTYPE html>
<html>
<head>
<style>
a:link {
    background-color: yellow;
}

a:visited {
    background-color: cyan;
}

a:hover {
    background-color: lightgreen;
}

a:active {
    background-color: hotpink;
}
</style>
</head>
<body>

<p><b><a href="default.asp" target="_blank">This is a link</a></b></p>
<p><b>Note:</b> a:hover MUST come after a:link and a:visited in the CSS definition in order to be effective.</p>
<p><b>Note:</b> a:active MUST come after a:hover in the CSS definition in order to be effective.</p>

</body>
</html>







Html Code Result:

Note: Copy this Code in Your Notepad Then See Result.

Post a Comment

 
Top