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