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

Answer key

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

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