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

Answer key

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

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