3D魔方

.container {width:300px; height:auto;margin:100px auto; position:relative; transform-style:preserve-3d;animation:mymove 8s linear 0.1s infinite;   transform-origin: 50% 50%;

   backface-visibility: hidden;}

@keyframes mymove

{

0% {transform:rotateX(360deg)rotateY(360deg) translateZ(10em);}

100% {transform:rotateX(-180deg)rotateY(-360deg) translateZ(0em);}

}

.cell {width:296px; height:296px;position:absolute; top:0;}

.div1 {transform:translateZ(150px);}

.div2 {transform:rotateY(90deg)translateZ(150px);}

.div3{transform:rotateX(90deg)translateZ(150px);}

.div4 {transform:rotateY(-90deg)translateZ(150px);}

.div5 {transform:rotateX(-90deg)translateZ(150px);}

.div6 {transform:rotateY(180deg)translateZ(150px);}

 

.div1 > div {background:LightSlateBlue;width:90px; height:90px; border:3px solid white; border-radius:10px;float:left;}

.div2 > div {background:LightCoral;width:90px; height:90px; border:3px solid white; border-radius:10px;float:left;}

.div3 > div {background:DeepSkyBlue;width:90px; height:90px; border:3px solid white; border-radius:10px;float:left;}

.div4 > div {background:DarkTurquoise;width:90px; height:90px; border:3px solid white; border-radius:10px;float:left;}

.div5 > div {background:HotPink;width:90px; height:90px; border:3px solid white; border-radius:10px;float:left;}

.div6 > div {background:GreenYellow;width:90px; height:90px; border:3px solid white; border-radius:10px;float:left;}

 

.cell > div:nth-child(2) {margin:0 4px4px 4px;}

.cell > div:nth-child(5) {margin:0 4px4px 4px;}

.cell > div:nth-child(8) {margin:0 4px4px 0;}

.cell > div:nth-child(1){margin-bottom:4px;}

.cell > div:nth-child(3){margin-bottom:4px;}

.cell > div:nth-child(4){margin-bottom:4px;}

.cell > div:nth-child(6){margin-bottom:4px;}

 

 

<div class="container">

<div class="cell div1">

<div></div>

<div></div>

<div></div>

<div></div>

<div></div>

<div></div>

<div></div>

<div></div>

<div></div>

</div>

<div class="cell div2">

<div></div>

<div></div>

<div></div>

<div></div>

<div></div>

<div></div>

<div></div>

<div></div>

<div></div>

</div>

<div class="cell div3">

<div></div>

<div></div>

<div></div>

<div></div>

<div></div>

<div></div>

<div></div>

<div></div>

<div></div>

</div>

<div class="cell div4">

<div></div>

<div></div>

<div></div>

<div></div>

<div></div>

<div></div>

<div></div>

<div></div>

<div></div>

</div>

<div class="cell div5">

<div></div>

<div></div>

<div></div>

<div></div>

<div></div>

<div></div>

<div></div>

<div></div>

<div></div>

</div>

<div class="cell div6">

<div></div>

<div></div>

<div></div>

<div></div>

<div></div>

<div></div>

<div></div>

<div></div>

<div></div>

</div>

</div>

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值