Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> CSS

วิธีใช้ 2D/3D Transformation กับองค์ประกอบ CSS

ใช้คุณสมบัติ transform ใน CSS เพื่อใช้การแปลง 2D หรือ 3D กับองค์ประกอบ

ตัวอย่าง: หมุนองค์ประกอบ

<!DOCTYPE html> <html>    <head>       <style>          div {             width: 200px;             height: 100px;             background-color: gray;             transform: rotate(10deg);          }       </style>    </head>    <body>       <h1>Rotation</h1>      <div>Demo</div>    </body> </html>