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

Answer key

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

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