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

Answer key

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

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