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