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