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