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