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