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

Answer key

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

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