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

Answer key

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

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