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

Answer key

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

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