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