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

Answer key

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

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