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