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