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