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