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