亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

利用CSS實現(xiàn)立方體360度旋轉(zhuǎn)效果實例代碼

  發(fā)布時間:2016-10-18 16:08:08   作者:佚名   我要評論
這篇文章通過實例代碼給大家介紹了利用CSS實現(xiàn)立方體360度旋轉(zhuǎn)效果的方法,實現(xiàn)后的效果非常炫酷,而且實現(xiàn)的代碼非常簡單,對大家的理解和學習很有幫助,有需要的朋友們下面來一起看看吧。

靜態(tài)效果圖如下:

示例代碼:

復(fù)制代碼
代碼如下:

<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<style>
* { margin: 0; padding: 0}
ul {list-style: none;}
ul {
width: 200px;
height: 200px;
margin: 200px auto;
position: relative;
transition: all 6s;
/*6秒時間轉(zhuǎn)變*/
transform-style: preserve-3d;
/*放在父盒子內(nèi)*/
}
ul li {
width: 100%;
height: 100%;
position: absolute;
text-align: center;
line-height: 200px;
font-size: 40px;
color: #fff;
}
li:nth-child(1){
transform: rotateX(0deg) translateZ(100px);
/*translateZ是為了讓立方體出現(xiàn)形狀*/
background-color: rgba(255, 0, 0, 0.6);
}
li:nth-child(2){
transform: rotateX(-90deg) translateZ(100px);
background-color: rgba( 0, 255,0, 0.6);
}
li:nth-child(3){
transform: rotateX(-180deg) translateZ(100px);
background-color: rgba(0,0,255,0.5);
}
li:nth-child(4){
transform: rotateX(-270deg) translateZ(100px);
background-color: rgba(50,50,25,0.5);
}
li:nth-child(5){
transform: rotateY(-90deg) translateZ(100px);
background-color: rgba(255,0,255,0.5);
}
li:nth-child(6){
transform: rotateY(90deg) translateZ(100px);
background-color: rgba(0,255,255,0.5);
}
ul:hover{
transform :rotateX(360deg) rotateY(360deg);
}
</style>
</head>
<body>
<ul>
<li>第1個盒子</li>
<li>第2個盒子</li>
<li>第3個盒子</li>
<li>第4個盒子</li>
<li>第5個盒子</li>
<li>第6個盒子</li>
</ul>
</body>
</html>

總結(jié)
以上就是利用CSS實現(xiàn)立方體效果的全部內(nèi)容,希望本文的內(nèi)容對大家的學習或者工作能帶來一定的幫助,如果有疑問大家可以留言交流。

相關(guān)文章

最新評論