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