css3動畫2D、3D轉換的方法

來源:互聯網
上載者:User
這篇文章介紹css3動畫2D、3D轉換的方法

css3動畫的2D、3D轉碼:

<!DOCTYPE html><html lang="en"><head>    <meta charset="UTF-8">    <title>css3動畫</title>    <style type="text/css">        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*/        }    </style></head><body><p>這個是測試1</p><br/><p class="p1">這個是測試2</p><br/><p class="p2">這個是測試2</p><br/><p class="p3">這個是測試2</p><br/><p class="p4">這個是測試2</p><br/><p class="p5">這個是測試2</p><br/><p class="p6">這個是測試2</p><br/></body></html>

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.