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