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

Answer key

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

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