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

Answer key

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

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