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