HTML Worksheet: Images and Alt Text
Code tip (File and words): <img src="file.jpg" alt="what it shows" width="200"> — no closing tag. src = which file to load; alt = words describing it; width / height = size in pixels. If the picture fails, the browser shows the alt text; screen readers read it aloud.
NameDateTime takenScore ___ / 40
- 1.🖼️ Does <img> need a closing tag? (a) Yes (b) No
- 2.🖼️ Why do we add alt text to an image? (a) to load it faster (b) to make it bigger (c) to colour it (d) to describe the image
- 3.🖼️ Which attribute of <img> names the picture file? (a) width (b) alt (c) height (d) src
-
4.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="dog.jpg" alt="A happy dog" width="200"> (a) dog.jpg (b) The full moon (c) width (d) A happy dog -
5.🖼️ Which picture file does the browser load?
<img src="moon.png" alt="The full moon" width="100"> (a) fort.jpg (b) The full moon (c) moon.png (d) bus.jpg -
6.🖼️ How many pixels wide is the picture drawn?
<img src="tiger.jpg" alt="A tiger asleep" width="350"> -
7.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="fort.jpg" alt="An old fort" width="100"> (a) A tiger asleep (b) width (c) fort.jpg (d) An old fort -
8.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="fort.jpg" alt="An old fort" width="150"> (a) An old fort (b) A tiger asleep (c) fort.jpg (d) width - 9.True or false: in <img>, alt sets how tall it is. (a) False (b) True
-
10.🖼️ How many pixels wide is the picture drawn?
<img src="bus.jpg" alt="Our school bus" width="250"> - 11.🖼️ Which attribute of <img> is read by screen readers? (a) height (b) width (c) src (d) alt
-
12.🖼️ How many pixels wide is the picture drawn?
<img src="kite.png" alt="A red kite" width="300"> -
13.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="map.png" alt="Map of India" width="200"> (a) Birthday cake (b) map.png (c) width (d) Map of India - 14.🖼️ Which attribute of <img> describes the picture? (a) height (b) src (c) alt (d) width
-
15.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="cake.jpg" alt="Birthday cake" width="150"> (a) cake.jpg (b) width (c) A happy dog (d) Birthday cake - 16.True or false: in <img>, src tells which image to load. (a) False (b) True
-
17.🖼️ Which picture file does the browser load?
<img src="tiger.jpg" alt="A tiger asleep" width="250"> (a) map.png (b) A tiger asleep (c) kite.png (d) tiger.jpg - 18.🖼️ Which attribute of <img> sets how tall it is? (a) height (b) src (c) width (d) alt
-
19.🖼️ How many pixels wide is the picture drawn?
<img src="kite.png" alt="A red kite" width="100"> -
20.🖼️ Which picture file does the browser load?
<img src="cake.jpg" alt="Birthday cake" width="50"> (a) Birthday cake (b) dog.jpg (c) cake.jpg (d) moon.png -
21.🖼️ Which picture file does the browser load?
<img src="tiger.jpg" alt="A tiger asleep" width="100"> (a) map.png (b) A tiger asleep (c) tiger.jpg (d) kite.png - 22.🖼️ Which attribute of <img> tells which image to load? (a) alt (b) height (c) width (d) src
-
23.🖼️ How many pixels wide is the picture drawn?
<img src="fort.jpg" alt="An old fort" width="400"> - 24.True or false: in <img>, src is read by screen readers. (a) False (b) True
- 25.True or false: in <img>, alt describes the picture. (a) True (b) False
-
26.🖼️ Which picture file does the browser load?
<img src="fort.jpg" alt="An old fort" width="200"> (a) An old fort (b) kite.png (c) tiger.jpg (d) fort.jpg - 27.True or false: in <img>, alt shows if the image fails. (a) True (b) False
-
28.🖼️ How many pixels wide is the picture drawn?
<img src="kite.png" alt="A red kite" width="150"> -
29.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="map.png" alt="Map of India" width="150"> (a) map.png (b) width (c) Map of India (d) Birthday cake -
30.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="tiger.jpg" alt="A tiger asleep" width="150"> (a) tiger.jpg (b) width (c) A tiger asleep (d) A red kite -
31.🖼️ Which picture file does the browser load?
<img src="tiger.jpg" alt="A tiger asleep" width="200"> (a) kite.png (b) map.png (c) tiger.jpg (d) A tiger asleep - 32.True or false: in <img>, alt is read by screen readers. (a) False (b) True
-
33.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="bus.jpg" alt="Our school bus" width="50"> (a) Our school bus (b) width (c) An old fort (d) bus.jpg -
34.🖼️ How many pixels wide is the picture drawn?
<img src="moon.png" alt="The full moon" width="100"> -
35.🖼️ How many pixels wide is the picture drawn?
<img src="bus.jpg" alt="Our school bus" width="350"> - 36.🖼️ Which attribute of <img> sets how wide it is? (a) height (b) alt (c) src (d) width
-
37.🖼️ How many pixels wide is the picture drawn?
<img src="tiger.jpg" alt="A tiger asleep" width="250"> -
38.🖼️ How many pixels wide is the picture drawn?
<img src="map.png" alt="Map of India" width="150"> - 39.🖼️ Which attribute of <img> shows if the image fails? (a) width (b) alt (c) src (d) height
-
40.🖼️ How many pixels wide is the picture drawn?
<img src="kite.png" alt="A red kite" width="400">
Answer key
- No
- to describe the image
- src
- A happy dog
- moon.png
- 350
- An old fort
- An old fort
- False
- 250
- alt
- 300
- Map of India
- alt
- Birthday cake
- True
- tiger.jpg
- height
- 100
- cake.jpg
- tiger.jpg
- src
- 400
- False
- True
- fort.jpg
- True
- 150
- Map of India
- A tiger asleep
- tiger.jpg
- True
- Our school bus
- 100
- 350
- width
- 250
- 150
- alt
- 400
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids