What are the different ways to use different colors for different links or same link?
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 to use it and see the change in the link color. It is shown as:
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}
0 Answers
0Be the first to answer this interview question.
Your Answer
Sign in to post your answer and help the community.