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