What is the difference between absolute positioning and fixed positioning relative to body? Why can fixed positioning exist all the time?

what is the difference between absolute positioning and fixed positioning relative to body? Why can fixed positioning always exist? A beginner"s explanation of a straight point of view. Thank you

Mar.19,2021

absolute positioning locates the element of relative/absolute/fixed relative to the nearest parent of the element .
fixed positioning is positioned relative to the html root node.


absolute positioning relative to element
fixed positioning relative to browser window


fixed positioning is set relative to browser window. Absolute positioning is the parent of a relative positioning element. If the parent doesn't have a location, he will keep looking up. Until it reaches the outermost body.


there is a concept of containing blocks here

Menu