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