Css Sibling Absolute Positioning

Solution 1:

Absolute positioning is dependent on the "current positioning context", which may include a parent element (if absolutely or relatively positioned) but will never include a sibling element.

Can you reorganize your dom so that you have a parent-child instead of siblings? If so, you could set the parent's position to relative or absolute and the child's position to absolute and the child's position would remain absolute in relation to the parent.

Solution 2:

There is no way using absolute position, according to w3c specification:

In the absolute positioning model, a box is explicitly offset with respect to its containing block

— relatively to parent block, not to sibling one

And no way to use relative positioning, also according to to w3c specification:

Once a box has been laid out according to the normal flow or floated, it may be shifted relative to this position.

— relatively to block's position, not to sibling block

summary:

Nobody can solve problem you described