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

Answer key

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

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