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

Answer key

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

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