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