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

Answer key

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

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