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