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