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