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