Why is overflow interacting with z-index?

前端 未结 4 1761
挽巷
挽巷 2021-02-12 20:28

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:10

    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.

提交回复
热议问题