๐Ÿ”นposition

โ•ฑ๐Ÿšง under construction

CSS โŸฉ layout โŸฉ position

"position"   "top/left" relative to               removed from flow
-----------------------------------------------------------------------
fixed        `viewport`                                  โœ… 
relative     where it should be                          โŒ 
absolute     `document` / nearest positioned parent      โœ… 
  • static ๆ˜ฏ้ ่จญๅฑฌๆ€ง๏ผŒไธๆœƒ่ขซๅญๅ…ƒ็ด ่ฆ–็‚บๆ˜ฏใ€Œๅฎšไฝ็ˆถๅ…ƒ็ด ใ€ ใ€‚

  • By default, any positioned element appears in front of any non-positioned elements.

By setting top/bottom, left/right , you also implicitly define the width / height of the (fixed and absolutely, but not relatively positioned) element.

Last updated

Was this helpful?