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