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

Answer key

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

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