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