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