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