🔹top

CSSlayout ⟩ top

top 隨著不同的 position 設定,而有不同的效果:

  • absolute or fixed自己上方 outer margin父容器上方的 inner border 的距離。

  • relative:自己 (從正常位置) 往下移動的距離。

  • stickytop property is used to compute the sticky-constraint rectangle.

  • statictop 無效果

/* top: 父元素的 top 到自己的 top 的距離 */
top: 125%;    /* 100% 代表父元素的高度 */

Last updated

Was this helpful?