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

Answer key

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

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