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

Answer key

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

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