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