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

Answer key

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

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