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