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