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

Answer key

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

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