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