W3Schools says that
element with
position: absolute
is positioned relative to the nearest positioned ancestor. Where positioned element is one whose position is anything except static.
My question is why are static
elements excluded?
I know that I can set
position: relative;
left:0px;
top:0px;
right:0px;
bottom:0px
which is the same as position:static
, but in my opinion, it looks like a workaround.
static
by default, to affect an absolute positioned child. – Lastminute