CSS3實現的3D旋轉效果,css33d旋轉

來源:互聯網
上載者:User

CSS3實現的3D旋轉效果,css33d旋轉

CSS3實現的3D旋轉效果:
由於CSS3的出現,實現3D動畫效果也更為輕鬆便捷,下面就是一段能夠實現3D旋轉效果的代碼,希望對大家能夠帶來參考作用。
代碼如下:

 

<!DOCTYPE html><html><head><meta charset=" utf-8"><meta name="author" content="http://www.softwhy.com/" /><title>螞蟻部落</title><style type="text/css">* {  font-size:14px;  color:#fff;  padding:0;  margin:0;}#container {  position:relative;  height 300px;  width:300px;  -webkit-perspective:500;  margin-top:200px;  margin-right:auto;  margin-left:auto;}#parent {  margin:10px;  width:280px;  height:280px;  background-color:#666;  opacity:0.3;  -webkit-transform-style:preserve-3d;  -webkit-animation:spin 15s infinite linear;}#parent > div {  position:absolute;  top:40px;  left:40px;  width:280px;  height:200px;  padding:10px;  -webkit-box-sizing:border-box;}#parent > :first-child {  background-color:#000;  -webkit-transform:translateZ(-100px) rotateY(45deg);}#parent > :last-child {  background-color:#333;  -webkit-transform:translateZ(50px) rotateX(20deg);  -webkit-transform-origin:50% top;}/*執行Y軸旋轉360度動畫*/@-webkit-keyframes spin{  from{    -webkit-transform: rotateY(0);  }  to{    -webkit-transform: rotateY(360deg);  }}</style></head><body><div id="container">  <div id="parent">    <div><a href="#">螞蟻部落歡迎您</a></div>  </div></div></body></html>

 

原文地址是:http://www.softwhy.com/forum.php?mod=viewthread&tid=11843

更多內容可以參閱:http://www.softwhy.com/divcss/

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.