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