In a responsive design, you have a sidebar that should stick to the top after scrolling past its initial position but stop sticking when it reaches the footer. Which positioning property would you apply to the sidebar?

  • Absolute
  • Fixed
  • Relative
  • Sticky
To create a sidebar that sticks to the top after scrolling past its initial position but stops sticking when it reaches the footer, you should apply the "position: sticky" property. It maintains the element's natural position until a specified scrolling threshold is reached, and then it behaves as if it were fixed.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *