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