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

Answer key

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

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