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

Answer key

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

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