work hard work smart

专注于Java后端开发。 不断总结,举一反三。
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

CSS3 rotate

Posted on 2012-01-11 10:54  work hard work smart  阅读(6319)  评论(0编辑  收藏  举报

1、rotate 旋转角度

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<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>
</html>

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度。