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

Answer key

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

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