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