css3-魔方

來源:互聯網
上載者:User

標籤:set   har   auto   doc   tle   htm   section   ott   ansi   

 1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4     <meta charset="UTF-8"> 5     <title>魔方</title> 6     <style type="text/css"> 7         section{width: 100px;height:100px;border:5px solid red; margin:50px auto;padding:100px;perspective: 800px;} 8         .box {width:100px;height:100px;position:relative; 9             transform-style:preserve-3d;10             transition:4S;11             transform-origin:center center -50px;12         }13         .box div{width: 100px;height:100px;position:absolute;color:white;font-size:50px;text-align: center;line-height:100px;}14         .box div:nth-of-type(1){15             background: #FF6600;;16             transform:translateX(-100px) rotateY(-90deg);17             transform-origin:right;18         }19         .box div:nth-of-type(2){20             background:red ;21             transform:translateY(-100px) rotateX(90deg);22             transform-origin:bottom ;23 24                  }25         .box div:nth-of-type(3){26             background:darkviolet;27             transform:translateX(100px) rotateY(90deg);28             transform-origin:left;29         }30         .box div:nth-of-type(4){31             background:yellow;32             transform: translateY(100px) rotateX(-90deg) ;33             transform-origin:top;34         }35         .box div:nth-of-type(5){36             background:green;37             transform:translateZ(-100px) rotateY(180deg);38 39         }40         .box div:nth-of-type(6){41             background:blue;42         }43         section:hover .box{44             transform: rotateX(270deg) rotateY(-270deg) rotateX(-270deg) rotateY(270deg) ;45 46         }47     </style>48 </head>49 <body>50     <section>51         <div class="box">52             <div>1</div>53             <div>2</div>54             <div>3</div>55             <div>4</div>56             <div>5</div>57             <div>6</div>58         </div>59     </section>60 </body>61 </html>

這兩天在學習HTML5+CSS3樣式,按老師的作業做了一個魔方!


css3-魔方

相關文章

聯繫我們

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