HTML and CSS Certification Practice Test 2026 - Free HTML and CSS Practice Questions and Study Guide

Question: 1 / 400

What is the correct CSS syntax to change the font color of a visited link to magenta?

a:visited{color: magenta;}

The correct syntax to change the font color of a visited link to magenta is accomplished by using the pseudo-class `:visited`. This pseudo-class is specifically designed to target links that the user has already clicked on and visited, and it allows you to apply specific styles to those links.

In this case, using `a:visited { color: magenta; }` indicates that any link that has been visited will change its text color to magenta. This is an important distinction because it differentiates between links that have been clicked (visited) and those that have not yet been interacted with (unvisited links).

It's important to note that the other options provided access different states of links. For example, the `:link` pseudo-class is for unvisited links, which is not applicable for this question since we want to style visited links. The `:hover` pseudo-class applies styles when a user hovers over a link, which does not address the requirement of changing the color for visited links. Lastly, the `:active` pseudo-class applies styles when a link is being clicked on, which again is not relevant for identifying visited links.

Thus, the use of the `:visited` pseudo-class is the essential component for targeting

Get further explanation with Examzify DeepDiveBeta

a:link{color: magenta;}

a:hover{color: magenta;}

a:active{color: magenta;}

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy