效果
完整代码
HTML:
<div class="container"> <div class="card">Card 1</div> <div class="card">Card 2</div> <div class="card">Card 3</div> <div class="card">Card 4</div> <div class="card">Card 5</div> <div class="card">Card 6</div> </div>
css
body { margin: 0; padding: 0; display: flex; justify-content: center; align-items: center; min-height: 100vh; background: linear-gradient(45deg, #ff9a9e 0%, #fad0c4 99%, #fad0c4 100%); font-family: Arial, sans-serif; perspective: 1000px; } .container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; transform-style: preserve-3d; animation: rotate 4s infinite ease-in-out; } @keyframes rotate { 0%, 100% { transform: rotateY(0deg); } 50% { transform: rotateY(30deg); } } .card { width: 200px; height: 250px; background: rgba(255, 255, 255, 0.1); border-radius: 15px; overflow: hidden; display: flex; justify-content: center; align-items: center; backdrop-filter: blur(5px); border: 1px solid rgba(255, 255, 255, 0.2); transition: all 0.5s cubic-bezier(0.23, 1, 0.320, 1); font-size: 24px; color: white; text-shadow: 0 0 10px rgba(0,0,0,0.5); } .card:hover { transform: translateY(-20px) scale(1.05); box-shadow: 0 20px 30px rgba(0,0,0,0.2);