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

Answer key

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

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