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

Answer key

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

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