CSS matrix() 函数

cssweb developmentfront end technology更新于 2024/11/19 21:00:17

CSS 中的 matrix() 函数用于定义一个齐次二维变换矩阵。将线性变换设置为参数。

示例

来看一个例子 −

<!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.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>
.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.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>

输出


相关文章


有用资源