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