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