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