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

Answer key

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

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