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