<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <style> ul{ position: relative; width: 200px; height: 200px; transform-style: preserve-3d; margin: 250px auto; animation: run 5s infinite linear; } li{ list-style: none; width:200px; height: 200px; position: absolute; left: 0; top: 0; opacity: 0.4; } li:first-child{ background: #FF0000; transform: translateZ(100px); } li:nth-child(2){ background: #FF0033; transform: translateY(-100px) rotateX(90deg); }li:nth-child(3){ background: #FF3300; transform: translateY(100px) rotateX(90deg); }li:nth-child(4){ background: #CC0000; transform: translateX(-100px) rotateY(90deg); }li:nth-child(5){ background: #CC0033; transform: translateX(100px) rotateY(90deg); }li:nth-child(6){ background: #990000; transform: translateZ(-100px); } @keyframes run { 0%{ transform:rotateX(0deg) rotateY(0deg); } 100%{ transform:rotateX(360deg) rotateY(360deg); } } </style> </head> <body> <ul> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> </ul> </body> </html>
html3D旋转动画
最新推荐文章于 2024-10-13 08:49:06 发布