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