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