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