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

Answer key

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

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