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