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