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

Answer key

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

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