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