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

Answer key

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

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