这篇文章介绍css3动画2d、3d转换的方法
css3动画的2D、3D转换代码:
css3动画 p{width:100px;height:100px;background: rebeccapurple;color:#fff;} .p1{ /*translate:移动(x,y)*/ transform:translate(100px,100px); -webkit-transform: translate(100px,100px);/*safari,chrome*/ -ms-transform: translate(100px,100px);/*IE*/ -o-transform:translate(100px,100px);/*opera*/ -moz-transform: translate(100px,100px);/*firefox*/ } .p2{ /*rotate:旋转(旋转角度edg)*/ transform:rotate(100deg); -webkit-transform:rotate(100deg);/*safari,chrome*/ } .p3{ /*scale:缩放(宽,高)*/ transform:scale(1,2); -webkit-transform:scale(1,2);/*safari,chrome*/ } .p4{ /*skew:倾斜(围绕x轴旋转,围绕y轴旋转)*/ transform:skew(20deg,20deg); -webkit-transform:skew(20deg,20deg);/*safari,chrome*/ } .p5{ /*matrix矩阵,定义 2D 转换,使用六个值的矩阵 定义 3D 转换,使用 16 个值的 4x4 矩阵*/ transform:matrix(0.586,0.8,-0.8,0.866,0,0); -webkit-transform: matrix(0.586,0.8,-0.8,0.866,0,0); } /*3D转换*/ .p6{ /*rotateX:(围绕x轴旋转)*/ /*rotateY:(围绕y轴旋转)*/ transform:rotateX(120deg); -webkit-transform:rotateX(120deg);/*safari,chrome*/ }这个是测试1
这个是测试2
这个是测试2
这个是测试2
这个是测试2
这个是测试2
这个是测试2
登录后复制
立即学习“前端免费学习笔记(深入)”;
以上就是css3动画2D、3D转换的方法的详细内容,更多请关注【创想鸟】其它相关文章!
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。