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