Lesson 7 of 8

Clear links

Goal

An underline that keeps clear of the letters

01

Explanation

Readers need to know that text is a link before they read it, and color alone isn't enough: someone who can't tell colors apart sees no difference between blue and black. That's why links keep their underline, and removing it with text-decoration: none is one of the most common design mistakes.

But the default underline hugs the letters and crowds their descenders, the tails that hang below the line in letters like g, p and y. Use text-underline-offset to move it away from them, and text-decoration-thickness to set its weight so it doesn't overpower the text.

Then come the states: :hover confirms to the reader that the text can be clicked, and :visited reminds them which pages they've already seen. The browser only accepts color properties in :visited, so a page can't use it to read your browsing history.

02

Your task

Bring back the underline on .prose links, with a set thickness and a gap between it and the letters, give :visited its own color, and make :hover highlight the link.

Checks

5 checks
  1. The links are underlined
  2. The underline thickness is set, not left on auto
  3. The underline sits away from the letters
  4. The :visited state colors links the reader has visited
  5. The :hover state highlights the link
03

Hints

0/3
Track lessons0 of 8 done

Learn to scale headings, choose the right units, and set line length and text direction, because text is what people read most in any interface.

Beginner level, 8 lessons, 1.5 hours in total.

index.html
Preview
index.html100%
–/5

Press “Run and check” to grade your code.

5 checks listed under “Your task”.

Track lessons0 of 8 done

Learn to scale headings, choose the right units, and set line length and text direction, because text is what people read most in any interface.

Beginner level, 8 lessons, 1.5 hours in total.