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