← Images with img, src and alt lesson New set →

HTML Worksheet: Images and Alt Text

HTML and CSS lesson 7: Images with img, src and alt · Set 843 · 40 questions
TalentJR

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

Answer key

  1. Our school bus
  2. src
  3. 400
  4. False
  5. width
  6. True
  7. <img>
  8. 200
  9. No
  10. False
  11. dog.jpg
  12. to describe the image
  13. alt
  14. Birthday cake
  15. moon.png
  16. An old fort
  17. False
  18. False
  19. True
  20. Birthday cake
  21. True
  22. src
  23. 300
  24. kite.png
  25. Our school bus
  26. False
  27. 100
  28. A tiger asleep
  29. 150
  30. Birthday cake
  31. alt
  32. map.png
  33. 50
  34. A red kite
  35. height
  36. A red kite
  37. moon.png
  38. Birthday cake
  39. A red kite
  40. 250

Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids