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