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