W3 Web サイトで見られるように、この 3D 効果を再現しようとしています。
コードを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>