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