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