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