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