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

Answer key

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

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