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

Answer key

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

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