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