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