×

html · level 3 · unit 1 · lesson 2

  1. meet it
  2. guess first
  3. your turn
  4. fix it
  5. nailed it

Tap a green word if you get lost.

meet it

width and height save a space before the picture arrives.

Ever gone to tap a link, only for the page to jump so you tap something else? That jump is a . It happens when a picture arrives late and pushes everything below it down.

Give every <img> a width and a height, measured in pixels. A pixel is one of the tiny dots that make up a screen. Now the browser knows how much room to keep, even before the file has downloaded.

The two numbers also give the picture's , its shape. When a phone shows the picture smaller, the browser still keeps a space of the right shape.

<h1>Moss the shop cat</h1>
<img src="cat.svg" alt="Moss asleep in the shop window" width="800" height="600">
<p>Moss has lived in the shop since 2019. Say hello when you visit.</p>

Press show my page to see it here.

Write plain numbers, with nothing after them. Use the picture file's real size.