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