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