🔹position

╱🚧 under construction

CSSlayout ⟩ 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?