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

Answer key

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

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