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

Answer key

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

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