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

Answer key

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

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