When an element's position is absolute and no ancestors are positioned, it will be positioned relative to the ________.
- Body
- Document
- Nearest positioned ancestor
- Viewport
When an element's position is set to absolute and no ancestors are positioned (with relative, absolute, or fixed positioning), it is positioned relative to the viewport, which is the browser window. This means it's positioned in relation to the visible area of the web page.
Loading...
Related Quiz
- 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?
- Which CSS unit is relative to the root element's font size?
- If you want to vertically center an inline or inline-block element relative to its parent, you'd set "vertical-align" to ________.
- Which SASS/SCSS feature allows you to pass values when including a mixin?
- You're creating a fluid typography system where the font size should never go below 16px, never exceed 32px, and scale smoothly between these values based on the viewport width. Which CSS function will help you achieve this?