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