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

Answer key

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

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