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