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

Answer key

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

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