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

Answer key

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

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