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