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

Answer key

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

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