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