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

Answer key

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

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