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