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

Answer key

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

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