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

Answer key

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

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