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

Answer key

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

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