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

Answer key

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

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