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