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

Answer key

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

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