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