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