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

Answer key

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

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