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

Answer key

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

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