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