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