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

Answer key

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

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