Lar*_*ars 11 3d google-chrome css3 css-transforms
我正在尝试重新创建这个3D效果,如W3网站上所示.
我已将代码放在jsFiddle中,但正如您所看到的,已应用变换但交叉效果未正确呈现.它在Firefox中也不起作用.
这是Chrome的问题,还是代码问题?
<style>
.container {
background-color: rgba(0, 0, 0, 0.3);
transform-style: preserve-3d;
perspective: 500px;
}
.container > div {
position: absolute;
left: 0;
}
.container > :first-child {
transform: rotateY(45deg);
background-color: orange;
top: 10px;
height: 135px;
}
.container > :last-child {
transform: translateZ(40px);
background-color: rgba(0, 0, 255, 0.75);
top: 50px;
height: 100px;
}
</style>
<div class="container">
<div></div>
<div></div>
</div>
Run Code Online (Sandbox Code Playgroud)
这是为什么这个 3D CSS 重叠而不是剪辑的重复?...根据该问题,这是 webkit 中报告的错误:https://bugzilla.mozilla.org/show_bug.cgi?id =689498 :
Bug 689498 - 相交平面的 z 顺序不正确
Alistair MacDonald 2012-04-12 12:22:25 PDT Safari 和 Mobile Safari 不再有这个问题。Chrome 和 Firefox 中仍然存在该问题。
损坏:Firefox 14.0a1 (2012-04-12) -Win7 损坏:Chrome 20.0.1096.1 -Win7 已修复:Safari 5.1.5 (75.34.55.3) -Win7 已修复:Mobile Safari(最后更新一个多月前) -iOs
链接到测试用例和屏幕抓取: http://f1lt3r.com/code/3d-css-transforms-intersecting-planes-not-clipping/