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

Answer key

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

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