css3 翻转和旋转的区别 - roucheng

WBOY
Release: 2016-05-20 13:49:01
Original
1208 people have browsed it

我以前一直以为旋转跟翻转一样,今日自己旋转了好久都发觉跟翻转差一点点,纠结了十几分钟才明白,只能怪自己的立体感太差了。

        css3中的transform中有旋转,放缩,倾斜,平移的功能,分别对应的属性是:rotate,scale,skew,translate

        旋转:(rotate)

<span style="color: #800000;">-webkit-transform:rotate(10deg);  
-moz-transform:rotate(10deg);  
transform:rotate(10deg);  
</span><span style="color: #008000;">/*</span><span style="color: #008000;"> 何问起 hovertree.com </span><span style="color: #008000;">*/</span>
Copy after login

   翻转:(scale)

 

       (这个属性是放缩的功能,怎么能翻转的!原来括弧里面(1,1)前者表示X轴,后者表示Y轴,当数字大于1时放大,大于0并小于1时缩小,负数代表翻转)

       水平翻转:

<span style="color: #800000;">-webkit-transform:scale(-1,1);  
-moz-transform:scale(-1,1);  
transform:scale(-1,1);  
</span><span style="color: #008000;">/*</span><span style="color: #008000;"> 何问起 hovertree.com </span><span style="color: #008000;">*/</span>
Copy after login

垂直翻转:

<span style="color: #800000;">-webkit-transform:scale(1,-1);  
-moz-transform:scale(1,-1);  
transform:scale(1,-1);
</span><span style="color: #008000;">/*</span><span style="color: #008000;"> 何问起 hovertree.com </span><span style="color: #008000;">*/</span>  
Copy after login

在线示例:http://hovertree.com/code/css/css3dxuanzhuan.htm

特效:http://www.cnblogs.com/roucheng/p/texiao.html

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template