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