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