Is there a way to see the stacking context, in IE/Firefox/Chrome/etc.?

前端 未结 4 685
逝去的感伤
逝去的感伤 2021-01-30 12:41

I\'m trying to track down a z-index problem. I\'m looking at the page in IE9\'s DOM Inspector, and I just can\'t figure it out.

I have one element with a z-index of 100

4条回答
  •  忘了有多久
    2021-01-30 13:31

    If you use Chrome https://github.com/gwwar/z-context is a simple extension to see:

    • If the current element creates a stacking context, and why
    • What its parent stacking context is
    • The z-index value

    and important, like aprohl5 said: The z-index property can affect the stack order only if the position is explicitly set to fixed, absolute, or relative.

    This is a nice way to mantain order with Sass https://www.smashingmagazine.com/2014/06/sassy-z-index-management-for-complex-layouts/

提交回复
热议问题