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

Answer key

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

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