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