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