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

Answer key

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

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