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

Answer key

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

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