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

Answer key

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

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