To change the "relative to" positioning context for a specific DIV block in Webflow, you'll need to adjust both the DIV and its parent element’s positioning properties.
1. Understand How “Relative To” Works
- Absolute or fixed positioned elements are positioned relative to the nearest ancestor that has a position other than static (i.e., relative, absolute, or fixed).
- If no such ancestor exists, they are positioned relative to the body (i.e., the page itself).
2. Set the Parent Element’s Positioning
- Select the parent element (the one you want your DIV block to be positioned relative to).
- Go to the Style panel.
- Under the Layout section, set the Position to Relative (or Absolute, depending on your layout needs).
- This action makes this element the positioning context for any absolutely positioned children.
3. Set Your DIV Block’s Position
- Select the child DIV block.
- Go to the Style panel.
- Under Layout, set Position to Absolute or Fixed, depending on use case.
- You can now adjust top/right/bottom/left values relative to the parent that has non-static positioning.
4. Verify Context Is Applied
- Preview or publish your site.
- Ensure your DIV moves or stays exactly within the scope of the intended parent element.
Summary
To control what a DIV block is “relative to,” set its parent element’s position to relative (or absolute/fixed). Then, change the DIV’s position to absolute or fixed to activate its positioning in reference to that parent.