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