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