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