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

Answer key

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

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