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