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

Answer key

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

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