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