html · level 2 · unit 6 · lesson 1
- meet it
- guess first
- your turn
- fix it
- nailed it
Tap a green word if you get lost.
meet it
Alt text says what a picture means here, or nothing at all.
Good alt text says what the picture tells you in that place. On a recipe page, a cake photo might be A lemon cake with icing dripping down the sides. Skip words like picture of, because screen readers already say it is an image.
A picture, like a swirl or a little logo beside a heading, tells nobody anything. Give it empty alt text, alt="", and screen readers skip it.
A picture that is a link gets alt text saying where it goes, such as Home.
<h2><img src="logo.svg" alt="">Lemon drizzle cake</h2>
<img src="cake.svg" alt="A lemon cake with icing dripping down the sides">
<a href="https://example.com/"><img src="logo.svg" alt="Home"></a> Press show my page to see it here.
Never leave alt out. With no alt at all, a screen reader may read out the file name.
guess first
What does a screen reader say for this line?
Guess before you run it. Wrong guesses are how you learn, and nothing is marked.
<p><img src="tree.svg" alt="">Garden tips for November</p>
your turn
Your turn. Write alt text for each picture.
The ball on line 1 is only decoration, so delete its blank to leave the alt text empty. The dog on line 2 is the news: describe what it shows.
Press show my page to see it here.
- the decorative ball has empty altnot checked yet
- the dog picture is describednot checked yet
- no alt text says picture ofnot checked yet
fix it
The decorative logo has no alt at all. Can you fix it?
Press show my page to see it here.
- the decorative logo has empty altnot checked yet
- The logo is only decoration. What can a screen reader do with a picture that has no
alt? - With no
alt, it may read the file name. Empty alt makes it skip the picture. - Add
alt=""inside the<img>tag, then press run.
nailed it
your pictures say the right thing. :D
- Alt text says what a picture means in that place.
- Decorative pictures get empty
alt="". - Never leave
altout completely.
new words in your collection
- decorative
This lesson isn’t saved. A free account remembers every lesson you finish.