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