css2.2 层叠顺序 z-index

来自: https://www.w3.org/TR/CSS22/visuren.html#z-index


Within each stacking context, the following layers are painted in back-to-front order:

  1. the background and borders of the element forming the stacking context.
  2. the child stacking contexts with negative stack levels (most negative first).
  3. the in-flow, non-inline-level, non-positioned descendants.
  4. the non-positioned floats.
  5. the in-flow, inline-level, non-positioned descendants, including inline tables and inline blocks.
  6. the child stacking contexts with stack level 0 and the positioned descendants with stack level 0.
  7. the child stacking contexts with positive stack levels (least positive first).


在每个层叠上下文中,以下子元素按照 z 轴的正方向排列。即后面的覆盖前面的。

1.创建当前层叠上下文元素的背景和边框。

2.层叠顺序为负数的子层叠上下文。

3.正常流中的非inline,非定位元素。

4.非定位浮动元素。

5.正常流中的行内非定位元素,包括inline table 和 inline blocks。

6.层叠顺序为0的子层叠上下文、层叠顺序为0的定位元素。

7.层叠顺序为正数的子层叠上下文。


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值