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

Answer key

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

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