
1、css旋转属性为transform。
transform属性说明
2、transform属性将2D或3D转换为元素。这个特性允许我们旋转,缩放,移动或者倾斜元素。
transform属性旋转属性值:
rotate(angle) 定义 2D 旋转,在参数中规定角度。
rotate3d(x,y,z,angle) 定义 3D 旋转。
rotateX(angle) 定义沿着 X 轴的 3D 旋转。
rotateY(angle) 定义沿着 Y 轴的 3D 旋转。
rotateZ(angle) 定义沿着 Z 轴的 3D 旋转。
实例
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | <html>
<head>
<meta http-equiv= "Content-Type" content= "text/html; charset=utf-8" >
<title>DIV旋转属性的演示</title>
<meta http-equiv= "X-UA-Compatible" content= "IE=EmulateIE8" />
<style type= "text/css" >
body {
font-family : "Arial" , sans-serif ;
}
#example {
position : absolute ;
border : #09F solid 1px ;
font-weight : 900 ;
padding : 10px ;
display : block ;
width : 500px ;
height : 400px ;
margin-top : -1px ;
margin-left : -1px ;
transform: rotate( 40 deg);
-o-transform: rotate( 40 deg);
-webkit-transform: rotate( 40 deg);
-moz-transform: rotate( 40 deg);
filter: progid:DXImageTransform.Microsoft.Matrix(sizingMethod= 'auto expand' , M 11 = 1.2660444431189777 , M 12 = -0.3327876096865394 , M 21 = 0.1127876096865398 , M 22 = 0.9660444431189779 );
}
</style>
<!--[if IE]>
<style type= "text/css" >
#example {
top : 50px ;
left : 50px ;
}
</style>
<![endif]-->
</head>
<body>
<div id= "example" > 旋转成功</div>
</body>
</html>
|
以上就是css旋转属性的介绍,希望对大家有所帮助。更多编程基础知识学习:python学习网
本文教程操作环境:windows7系统、css3版,DELL G3电脑。