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