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