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