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

Answer key

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

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