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