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

Answer key

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

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