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