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

Answer key

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

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