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