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