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

Answer key

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

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