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