CSS skew() 函数

cssweb developmentfront end technology更新于 2024/11/17 14:36:17

skew() 函数用于在二维空间中倾斜元素。将要应用的倾斜量设置为 skew() 函数的参数。

示例

<!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.cainiaomax.com/numpy/images/numpy-mini-logo.jpg" alt="Numpy">
<img class="skew_img" src="https://www.cainiaomax.com/apache_spark/images/apache-spark-mini-logo.jpg" alt="Apache Spark">
</body>
</html>

输出

示例

现在让我们看另一个例子 −

<!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.cainiaomax.com/numpy/images/numpy-mini-logo.jpg" alt="Numpy">
<img class="skew_img" src="https://www.cainiaomax.com/apache_spark/images/apache-spark-mini-logo.jpg" alt="Apache Spark">
</body>
</html>

输出


相关文章


有用资源