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