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

Answer key

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

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