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

Answer key

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

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