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

Answer key

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

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