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