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