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