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

Answer key

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

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