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