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

Answer key

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

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