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

Answer key

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

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