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

Answer key

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

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