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

Answer key

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

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