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

Answer key

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

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