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

Answer key

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

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