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