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