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