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