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

Answer key

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

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