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

Answer key

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

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