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