Why is overflow interacting with z-index?

前端 未结 4 588
心在旅途
心在旅途 2021-02-12 20:41

I am trying to understand the rules behind z-index and how it interacts with the overflow property.

I have this html:


  
4条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-12 21:27

    Your problem

    Your problem is related to cell node that hides boxy when overflow is specified on cell node.

    The reason

    The reason behind is that boxy with position absolute does not contribute to height of cell and overflow hides it.

    Why is it shown without overflow?

    By default overflow is visible, which for browser means do not do anything special for overflow functionality and it does not need to render overflow => does not hide boxy.

提交回复
热议问题