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

Answer key

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

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