เมื่อใช้การแปลง 3 มิติ เราสามารถย้ายองค์ประกอบไปยังแกน x แกน y และแกน z
ตัวอย่าง
ตัวอย่างต่อไปนี้แสดงการแปลง 3D แกน x
<html>
<head>
<style>
div {
width: 200px;
height: 100px;
background-color: pink;
border: 1px solid black;
}
div#myDiv {
-webkit-transform: rotateX(150deg);
/* Safari */
transform: rotateX(150deg);
/* Standard syntax */
}
</style>
</head>
<body>
<div>
My website
</div>
<p>
Rotate X-axis
</p>
<div id = "myDiv">
My website
</div>
</body>
</html> ผลลัพธ์
