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

Answer key

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

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