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