ใช้วิธี translate3d(x,y,z) เพื่อแปลงองค์ประกอบโดยใช้แกน x แกน y และแกน z
ให้เราดูไวยากรณ์
translate3d(tx, ty, tz)
tx :เป็น
ที :เป็น
ทซ :เป็น
มาดูตัวอย่างกัน
div {
width: 50px;
height: 50px;
background-color: orange;
}
.trans {
transform: perspective(300px) translate3d(15px, 0, 0px);
background-color: black;
}