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