You're building a website's header and you want it to stay at the top of the viewport when users scroll. Which positioning property would you use?

  • Absolute
  • Fixed
  • Relative
  • Static
To keep the header at the top of the viewport when users scroll, you should use the "position: fixed" property. This makes the element's position relative to the browser window, ensuring it stays in place while the page content scrolls beneath it.
Add your answer
Loading...

Leave a comment

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