Chapter 10. Styling Links

In this lesson, you will learn how to style links. You also will learn how to add background images to links, turn off link underlines, use borders for underlines, and increase the active link area.

Links and Pseudo-Classes

You have already learned how to style <a> or link elements in Lesson 3, “Selectors in Action.” Now you will learn how to style the five different link states.

Links can be in the following states:

  • Normal—The standard unvisited link state

  • Visited—The link points to a URI that has already been visited

  • Hover—The cursor is over the active area of the link

  • Active—The moment the link is selected or clicked

  • Focus—The link is in focus and ready to accept input, such as a click or mouse down

Some link states ...

Get Sams Teach Yourself CSS in 10 Minutes now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.