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

Answer key

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

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