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