区分fixed、relative、absolute

fixed fixed positioning, position is fixed, with reference to the origin of the coordinate of top left corner of the browser.

relative relative positioning, position is relative, with reference to the coordinate origin of the parent coordinate origin. No parent coordinate origin on the reference body; if there is a parent css style padding etc., with its content inside the zone origin of coordinates.

absolute absolute positioning, as absolute position, the reference coordinates of the origin of the coordinate origin parent (parent set of relative position, which is used in conjunction with absolute and relative) and the use of top, right, bottom, left to locate. If not set and has a position relative to top, right, bottom, left and other properties, with reference to the origin of coordinates of top left corner of the browser.

Reference https://blog.csdn.net/jingtian678/article/details/64439712

       https://blog.csdn.net/qq_37856300/article/details/82799545

Guess you like

Origin blog.csdn.net/janthinasnail/article/details/90492846