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

Answer key

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

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