Applying Styles to Hyperlinks
By default in most browsers, textual hyperlinks appear as underlined blue text, and visited hyperlinks (that is, hyperlinks to pages you have already visited) appear as underlined purple text. You have probably seen Web sites where this wasn’t the case, though, and perhaps wondered how they did it.
Hyperlink formatting can be controlled by placing arguments in the <a> tag for each link, although it’s tedious to do so. For example, to make an individual hyperlink magenta:
<a href="foliage.htm" style="color: magenta">Diagnosing Foliage Problems</a>
You could apply a class to all hyperlinks, as you learned in the preceding section, but that method does not provide a way to distinguish between the visited and the unvisited ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access