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

Answer key

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

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