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

Answer key

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

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