• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

css3旋转是绕着哪根轴旋转

武飞扬头像
PHP中文网
帮助49

css3旋转是绕着哪根轴旋转

在css中,旋转可以顺时针逆时针旋转,也可以绕X、Y或Z轴旋转,不同的旋转样式对应不同的函数。

1、“rotate()”函数

利用“rotate()”函数,可使元素顺时针或逆时针旋转。

示例如下:

<html>
<head>
<style> 
div
{
margin:30px;
width:200px;
height:100px;
background-color:yellow;
/* Rotate div */
transform:rotate(9deg);
-ms-transform:rotate(9deg); /* Internet Explorer */
-moz-transform:rotate(9deg); /* Firefox */
-webkit-transform:rotate(9deg); /* Safari 和 Chrome */
-o-transform:rotate(9deg); /* Opera */
}
</style>
</head>
<body>
<div>Hello World</div>
</body>
</html>

输出结果:

学新通技术网

2、“rotateX()”函数

利用“rotateX()”函数,可使元素绕X轴旋转。示例如下:

<html>
<head>
<style> 
img{
transform:rotatex(180deg);
}
</style>
</head>
<body>
<img src="https://www.swvq.com/1118.02.png" alt="">
</body>
</html>

输出结果:

学新通技术网

3、“rotateY()”函数

利用“rotateY()”函数,可使元素绕Y轴旋转,示例如下:

<html>
<head>
<style> 
img{
transform:rotateY(180deg);
}
</style>
</head>
<body>
<img src="https://www.swvq.com/1118.02.png" alt="">
</body>
</html>

输出结果:

学新通技术网

4、“rotateZ()”函数

利用“rotateZ()”函数,可使元素绕Z轴旋转。示例如下:

<html>
<head>
<style> 
img{
transform:rotateZ(180deg);
}
</style>
</head>
<body>
<img src="https://www.swvq.com/1118.02.png" alt="">
</body>
</html>

输出结果:

学新通技术网

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /boutique/detail/tanfjcae
系列文章
更多 icon
同类精品
更多 icon
继续加载