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