Hàm xiên () được sử dụng để xiên một phần tử ở vị trí 2D. Đặt số lượng xiên được áp dụng làm tham số của hàm xiên ().
Ví dụ
<!DOCTYPE html>
<html>
<head>
<style>
.translate_img {
transform: translate(50px, 10%);
}
.skew_img {
transform-origin: top left;
transform: skew(45deg, 0);
}
</style>
</head>
<body>
<h1>Learn</h1>
<img class="translate_img" 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> Đầu ra
Ví dụ
Bây giờ chúng ta hãy xem một ví dụ khác -
<!DOCTYPE html>
<html>
<head>
<style>
.translate_img {
transform: translate(50px, 10%);
}
.skew_img {
transform-origin: top left;
transform: skew(-0.06turn, 18deg);
}
</style>
</head>
<body>
<h1>Learn</h1>
<img class="translate_img" 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> Đầu ra