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