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