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

Answer key

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

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