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