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