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

Answer key

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

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