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

Answer key

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

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