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