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

Answer key

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

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