What are the different ways to use different colors for different links or same link?

Asked: Apr 15, 2023

The presentation is being done by CSS that is used with the HTML, to give the style to the HTML content. This is called as style sheet. The links can be specified in different colors by the following way:

a:link {color: blue; background: white}a:visited {color: purple; background: white}a:active {color: red; background: white}

This is the CSS properties that is being defined to set the color for the links that are active, visited and normal link. User can use the class attribute in the tags like <a> to use it and see the change in the link color. It is shown as:

<a class="exp" href="[URL]">example of the link</a>

The style sheet can be modified according to the code that is being written. The coding will include:

a.exp:link {color: yellow; background: black}a.exp:visited {color: white; background: black}a.exp:active {color: red; background: black}

Asked by brijesh

Answers (0)

No answers yet. Be the first to answer!