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