Changing the Color of a Link in HTML:
Before learning the method of changing the color of a link in HTML, we would like to show you the default color of an HTML link so that when we will change it later, you will easily be able to recognize the difference. To demonstrate to you that, we have written the following simple HTML script:
In this HTML script, we have simply mentioned an HTML link by using the “href” tag in HTML.
When we executed this script with our browser, the web page shown below appeared on our screen. From here, you can see that the default color of an HTML link is blue.
Now, we will attempt to change this color to red. To do that, we have slightly modified the above HTML script in the following manner:
In this modified HTML script, we have simply used the “style” attribute of HTML with our link, and using this attribute, we have set the color of this link as red.
Upon execution of this modified script, our HTML link color changed to red, as you can witness from the web page shown in the image below:
With the help of this quick tutorial, you can instantly change the color of your HTML links. We have changed the default color of an HTML link to red in this guide. However, you can choose any color of your choice in which you want your HTML link to be displayed simply by mentioning its name with the “style-color” attribute of HTML.