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