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