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

Answer key

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

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