我们都知道,在css3里rotate()函数是能够旋转元素的,他主要是在二维空间内进行旋转操作,那么今天我们就给大家带来实例,看一下这个rotate()函数怎么使用。
如果对元素本身或者元素设置了perspective值,那么rotate3d()函数可以实现一个3维空间内的旋转。
取值
rotate(0c0cb308ee3d2ee3281772bfc9b806c2);0c0cb308ee3d2ee3281772bfc9b806c2为一个角度值,单位deg,可以为正数或者负数,正数是顺时针旋转,负数是逆时针旋转。
rotateX(angele),相当于rotate3d(1,0,0,angle)指定在3维空间内的X轴旋转
rotateY(angele),相当于rotate3d(0,1,0,angle)指定在3维空间内的Y轴旋转
rotateZ(angele),相当于rotate3d(0,0,1,angle)指定在3维空间内的Z轴旋转
语法
t
ransform:rotate(<angle>); CSS .rotate_clockwise{ -webkit-transform:rotate(45deg); -moz-transform:rotate(45deg); position:absolute; left:10px; top:80px; } .rotate_anticlockwise{ -webkit-transform:rotate(-45deg); -moz-transform:rotate(-45deg); position:absolute; left:200px; top:80px; } .rotateX{ -webkit-transform:perspective(800px) rotateX(60deg); -moz-transform:perspective(800px) rotateX(60deg); position:absolute; left:400px; top:80px; } .rotateY{ -webkit-transform:perspective(800px) rotateY(60deg); -moz-transform:perspective(800px) rotateY(60deg); position:absolute; left:600px; top:80px; } .rotateZ{ -webkit-transform:perspective(800px) rotateZ(60deg); -moz-transform:perspective(800px) rotateZ(60deg); position:absolute; left:800px; top:80px; } HTML <divclass="demo_box rotate_clockwise">顺时针旋转45度</div> <divclass="demo_box rotate_anticlockwise">逆时针旋转45度</div> <divclass="demo_box rotateX">3维空间内X轴旋转60度</div> <divclass="demo_box rotateY">3维空间内Y轴旋转60度</div> <divclass="demo_box rotateZ">3维空间内Z轴旋转60度</div>
相信看了这些案例你已经掌握了方法,更多精彩请关注php中文网其它相关文章!
相关阅读:
以上是CSS3函数rotate()怎么使用的详细内容。更多信息请关注PHP中文网其他相关文章!

重构自己的代码看起来是什么样的?约翰·瑞亚(John Rhea)挑选了他写的一个旧的CSS动画,并介绍了优化它的思维过程。

CSSanimationsarenotinherentlyhardbutrequirepracticeandunderstandingofCSSpropertiesandtimingfunctions.1)Startwithsimpleanimationslikescalingabuttononhoverusingkeyframes.2)Useeasingfunctionslikecubic-bezierfornaturaleffects,suchasabounceanimation.3)For

@keyframesispopularduetoitsversatoryand and powerincreatingsmoothcssanimations.keytricksinclude:1)definingsmoothtransitionsbetnestates,2)使用AnimatingmatematingmultationmatingMultationPropertiessimultane,3)使用使用4)使用BombingeNtibalibility,4)使用BombingingWithjavofofofofofoffo

CSSCOUNTERSAREDOMANAGEAUTOMANAMBERINGINWEBDESIGNS.1)他们可以使用forterablesofcontents,ListItems,and customnumbering.2)AdvancedsincludenestednumberingSystems.3)挑战挑战InclassINCludeBrowsEccerCerceribaliblesibility andperformiballibility andperformissises.4)创造性

使用滚动阴影,尤其是对于移动设备,是克里斯以前涵盖的一个微妙的UX。杰夫(Geoff)涵盖了一种使用动画限制属性的新方法。这是另一种方式。


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

Video Face Swap
使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热门文章

热工具

SublimeText3 Linux新版
SublimeText3 Linux最新版

Dreamweaver Mac版
视觉化网页开发工具

EditPlus 中文破解版
体积小,语法高亮,不支持代码提示功能

ZendStudio 13.5.1 Mac
功能强大的PHP集成开发环境

螳螂BT
Mantis是一个易于部署的基于Web的缺陷跟踪工具,用于帮助产品缺陷跟踪。它需要PHP、MySQL和一个Web服务器。请查看我们的演示和托管服务。