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

Answer key

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

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