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

Answer key

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

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