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