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