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

Answer key

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

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