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