计算机3d相册代码,CSS3实现3D旋转相册(示例代码)

静态效果图:

db19fbac6ed349548a934c5556449b16.jpg

代码如下:

Document

*{margin: 0;padding: 0;}

ul{

width: 200px;

height: 200px;

list-style: none;

margin: 100px auto;

position: relative;

transform-style: preserve-3d;

animation:xuanzhuan 6s linear infinite;

}

ul li{

width: 200px;

line-height: 200px;

text-align: center;

position: absolute;

left: 0;

top: 0;

}

ul li:nth-child(1){

background-color: red;

transform:rotateY(60deg) translateZ(200px);

}

ul li:nth-child(2){

background-color: orange;

transform:rotateY(120deg) translateZ(200px);

}

ul li:nth-child(3){

background-color: yellow;

transform:rotateY(180deg) translateZ(200px);

}

ul li:nth-child(4){

background-color: green;

transform:rotateY(240deg) translateZ(200px);

}

ul li:nth-child(5){

background-color: tomato;

transform:rotateY(300deg) translateZ(200px);

}

ul li:nth-child(6){

background-color: blue;

transform:rotateY(360deg) translateZ(200px);

}

ul:hover{

animation-play-state:paused;

}

@keyframes xuanzhuan{

from{

transform:rotateX(-10deg) rotateY(0deg);

}

to{transform:rotateX(-10deg) rotateY(360deg);

}

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值