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

Answer key

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

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