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