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

Answer key

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

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