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