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

Answer key

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

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