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