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

Answer key

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

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