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