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