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

Answer key

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

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