Why is absolute CSS not working with a static parent?

W3Schools says that

Element

c position: absoluteis located relative to the nearest located ancestor. where a positioned element is an element whose position is anything but static.

My question is: why are the elements staticexcluded? I know that I can set position: relative;left:0px;top:0px;right:0px;bottom:0pxwhat matches position:static, but IMO looks like a workaround.

+4
source share
2 answers

Just position: relativedo it.

, , .

, , , - , .

+4

, ?

absolute - , .

, : relative; left: 0px; top: 0px; right: 0px; bottom: 0px

. position .

+5

Source: https://habr.com/ru/post/1620116/


All Articles