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

Answer key

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

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