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