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