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