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