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

Answer key

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

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