transform:rotate属性绕轴旋转度数:
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
body{
transform-style:preserve-3d;
position: relative;
}
div{
color:rgb(47, 70, 3);
width:100px;
height:100px;
position: absolute;
top:200px;
left:300px;
background:rgb(215, 179, 240);
transition:1s;
}
body div:hover{
transform:rotate(45deg);/*改变的属性*/
}
</style>
</head>
<body>
<div>transform:</div>
</body>
</html>
- rotatez()
- rotatex()
- rotatey()
transform:scale属性放大倍数:
- scalex()
- scaley()
transform:translate属性移动px等:
- translatex()
- translatey()
- translatez相当于z-index改变层级数
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
body{
transform-style:preserve-3d;
position: relative;
}
div{
color:rgb(47, 70, 3);
width:100px;
height:100px;
position: absolute;
top:200px;
left:300px;
background:rgb(215, 179, 240);
transition:1s;
}
body div:hover{
transform:translate(45px,45px);/*设置的transform属性*/
opacity:0.8;
background:pink;
}
</style>
</head>
<body>
<div>transform:</div>
<div>transform:</div>
</body>
</html>
- translate(x的距离,y的距离)
transform:skew属性倾斜度数,比较有趣。
- skewx(),skewy()同理