เพื่อกำหนดว่าอิลิเมนต์ควรมองเห็นได้เมื่อไม่ได้หันหน้าจอหรือไม่ ให้ใช้คุณสมบัติ backface-visibility
ตัวอย่างโค้ด
<!DOCTYPE html>
<html>
<head>
<style>
.demo1 {
position: relative;
width: 150px;
height: 150px;
background-color: yellow;
perspective: 80px;
margin: 50px;
perspective-origin: left;
transform: rotateY(180deg);
}
.demo2 {
position: absolute;
padding: 20px;
background-color: orange;
transform-style: preserve-3d;
transform: rotateX(45deg);
backface-visibility: visible;
}
</style>
</head>
<body>
<h1>Rotation</h1>
<div class="demo1">Demo
<div class="demo2">Demo</div>
</div>
</body>
</html>
ค่าที่เป็นไปได้:
visible(ค่าเริ่มต้น) - มองเห็นด้านหลังhidden- ซ่อนด้านหลัง
การประยุกต์ใช้: สร้าง Flip Card, 3D Cube, Carousel 3D ที่ด้านหลังไม่ควรมองเห็น