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