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