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