我的PHP之旅
CSS3 rotate、translate、transform:scale、skew的说明
post by:风子 2012-7-20 12:00

1、rotate 旋转角度

<style type="text/css">
div
{
width:200px;
height:100px;
background-color:yellow;
/* Rotate div */
transform:rotate(30deg);
-ms-transform:rotate(30deg); /* IE 9 */
-moz-transform:rotate(30deg); /* Firefox */
-webkit-transform:rotate(30deg); /* Safari and Chrome */
-o-transform:rotate(30deg); /* Opera */
}
</style>
</head>
<body>
 
<div>Hello</div>
 
</body>

 

2、translate(50px,100px); 偏移。(50px距离left, 100px距离top) 

3、transform:scale(2,4); 拉伸。 (2为width扩大2倍,4为heigh扩大4倍)

4、skew(30deg,20deg); 30deg为水平上移动30度, 20deg为垂直上移动20度。

评论:
发表评论:
昵称

邮件地址 (选填)

个人主页 (选填)

内容