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

Answer key

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

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