CSS3 rotate3d() 函数

cssweb developmentfront end technology更新于 2024/11/19 22:04:17

CSS 中的 rotate3d() 函数用于在 3D 空间中旋转元素。将旋转量和角度设置为 rotate3d() 的参数。

示例

来看一个例子 −

<!DOCTYPE html>
<html>
<head>
<style>
.demo {
   transform: rotate3d(1, 1, 1, 45deg);
}
.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>

输出

示例

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

<!DOCTYPE html>
<html>
<head>
<style>
.demo {
   transform: rotate3d(1, 2, 0, 30deg);
   color: red;
   font-family: sans-serif;
   font-size: 30px;
}
.skew_img {
   transform-origin: left;
   transform: skew(-0.10turn, 30deg);
}
</style>
</head>
<body>
<h1>Learn</h1>
<p class="demo">Learn Apache Spark</p>
<img class="skew_img" src=
"https://www.cainiaomax.com/apache_spark/images/apache-spark-mini-logo.jpg"
alt="Apache Spark">
</body>
</html>

输出


相关文章


有用资源