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

Answer key

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

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