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