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