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