Setting the Hyperlink Color
24-01-18 Course- HTML5-Simple
Whenever a Web page is opened for the first time, the hyperlinks on it is blue in color. However, if you click a hyperlink, its color changes from blue to purple. You can also set the hyperlink color according to your requirements. For example, you can set the color of a hyperlink to be changed from blue to red when it is clicked. To do this, HTML provides the following three attributes, which can be used inside the <body> tag.
- link: Specifies he color of the hyperlink that has not been visited (or clicked) before on a Web page
- vlink: Specifies the color of the hyperlink that has been visited before on a Web page
- alink: specifies the color of currently active links
Let’s do the following steps to set the colors of the hyperlinks:
<!DOCTYPE html>
<head>
<title>Links </title>
</head>
<body link=”gree” vlink=”red” alink=”blue”>
<h1>Setting Hyperlink Colors</h1>
<a href=”page1.html” target=”_blank”>
<h2> Page 1 </h2></a>
<a href=”page2.html” target=”_blank”>
<h2> Page 2 </h2></a>
</body>
</html>
Save the document with the name LinkColors.html.