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