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