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