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