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