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

Answer key

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

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