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

Answer key

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

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