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