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