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