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