關於 CSS3 backface-visiable 與 overflow 屬性的衝突

最近在作一個 flip 效果的時候發現一個奇怪的問題,設置了 backface-visiable:hidden;overflow:hidden 的元素反轉180度之後背面沒有被隱藏,最終仍是被Google出來了,overflow會覆蓋transform-style: preserve-3d屬性,還有如下一些元素會致使transform-style: preserve-3d失效:

 
 

Don't set overflow: hidden on elements with 3D transformed children

DESCRIPTION

The 'back' face of the card has a rotateY(180deg) set on it. Both faces have backface-visibility: hidden set. Setting overflow: hidden on their parent (the card) causes the 3D transformed face ('back' face) to disappear and backface-visibility: hidden to be ignored for the other.css

From the spec (link):app

The following CSS property values require the user agent to create a flattened representation of the descendant elements before they can be applied, and therefore override the behavior of transform-style: preserve-3d:ide

  • overflow: any value other than visible.ui

  • filter: any value other than none.spa

  • clip: any value other than auto.3d

  • clip-path: any value other than none.code

  • isolation: used value of isolate.orm

  • mask-image: any value other than none.ip

  • mask-box-source: any value other than none.element

  • mix-blend-mode: any value other than normal.

The computed value of transform-style is not affected.

相關文章
相關標籤/搜索