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

Answer key

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

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