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