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

Answer key

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

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