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

ฟังก์ชันเมทริกซ์ CSS()


ฟังก์ชัน matrix() ใน CSS ใช้เพื่อกำหนดเมทริกซ์การแปลง 2D ที่เป็นเนื้อเดียวกัน ตั้งค่าการแปลงเชิงเส้นเป็นพารามิเตอร์

ตัวอย่าง

เรามาดูตัวอย่างกัน −

<!DOCTYPE html>
<html>
<head>
<style>
.demo {
   transform: matrix(2, 1, -1, 1, 190, 100);
}
.skew_img {
   transform-origin: top right;
   transform: skew(-0.10turn, 30deg);
}
</style>
</head>
<body>
<h1>Learn</h1>
<img class="demo" src="https://www.tutorialspoint.com/numpy/images/numpy-mini-logo.jpg" alt="Numpy">
<img class="skew_img" src="https://www.tutorialspoint.com/apache_spark/images/apache-spark-mini-logo.jpg" alt="Apache Spark">
</body>
</html>

ผลลัพธ์

ฟังก์ชันเมทริกซ์ CSS()

ตัวอย่าง

เรามาดูตัวอย่างอื่นกัน −

<!DOCTYPE html>
<html>
<head>
<style>
.demo {
   transform: matrix(0.9, 0.8, -0.8, 0.8, 100, -30);
}
.skew_img {
   transform-origin: left;
   transform: skew(-0.10turn, 30deg);
}
</style>
</head>
<body>
<h1>Learn</h1>
<img class="demo" src="https://www.tutorialspoint.com/numpy/images/numpy-mini-logo.jpg" alt="Numpy">
<img class="skew_img" src="https://www.tutorialspoint.com/apache_spark/images/apache-spark-mini-logo.jpg" alt="Apache Spark">
</body>
</html>

ผลลัพธ์

ฟังก์ชันเมทริกซ์ CSS()