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

Answer key

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

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