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