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

Answer key

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

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