>  기사  >  웹 프론트엔드  >  关于 CSS3 backface-visiable 与 overflow 属性的冲突_html/css_WEB-ITnose

关于 CSS3 backface-visiable 与 overflow 属性的冲突_html/css_WEB-ITnose

WBOY
WBOY원래의
2016-06-24 11:53:241242검색

最近在做一个 flip 效果的时候发现一个奇怪的问题,设置了 backface-visiable:hidden;overflow:hidden 的元素反转180度以后背面没有被隐藏,最终还是被Google出来了,overflow会覆盖transform-style: preserve-3d属性,还有以下一些元素会导致transform-style: preserve-3d失效:

 

参考地址: http://codepen.io/thebabydino/details/rACbl

 

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

By  Ana Tudor

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.

From the spec (link):

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:

  • overflow: any value other than visible.

  • filter: any value other than none.

  • clip: any value other than auto.

  • clip-path: any value other than none.

  • isolation: used value of isolate.

  • mask-image: any value other than none.

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

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

  • The computed value of transform-style is not affected.

    성명:
    본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.