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.
Loading...
Related Quiz
- Which property in CSS is used to align text to the center?
- What does the CSS property "line-height" primarily affect?
- The process by which styles are applied to an element based on their source and specificity is known as the ________.
- An element with display: none; differs from visibility: hidden; because the former ________.
- You're working on a responsive design where you want a row of items to wrap onto the next line when there isn't enough space. Which Flexbox properties would you adjust?