Every doc I read about absolute position says: "element is positioned relative to its closest positioned ancestor"
But when I use it with the sibling with position: relative that is before it, element with position absolute don't want to position itself relative to the ancestor, but it takes into account the position of the relative sibling in the document flow. I can't understand why is that. Absolute should be absolute, not relative to the whatever sibling element... Can somebody explain it to me ?
<div>
<div style="position:relative;">element1</div>
<div style="position:absolute;">element2</div>
</div>