When an element with position: absolute; is inside a positioned ancestor, to which element will it be positioned relative?
- To the nearest sibling element.
- To the parent element.
- To the top of the document.
- To the viewport.
When an element with 'position: absolute;' is inside a positioned ancestor, it will be positioned relative to its closest positioned ancestor. If there is none, it will be positioned relative to the viewport (the browser window).
Loading...
Related Quiz
- If you want to blend the background images of an element, which property would you use?
- What does the currentColor value represent in CSS?
- What is the default value of the box-sizing property in CSS?
- What is the role of the calc() function in CSS?
- The attr() function in CSS is used to retrieve the value of an HTML ______.