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

Answer key

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

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