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

Answer key

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

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