css九宫格切分照片悬浮动画效果代码
代码语言:html
所属分类:布局界面
代码描述:css九宫格切分照片悬浮动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> body { margin: 0; height: 100vh; display: grid; place-items: center; background: whitesmoke; perspective: 800px; } .card { transform-style: preserve-3d; position: relative; width: 300px; height: 400px; border-radius: 40px; background: white; box-shadow: 0 20px 60px -10px rgba(50, 50, 93, 0.6); transform: translate(0px, 0px) rotateX(1deg) rotateY(1deg); transition: all 0.25s linear; } .card:has(.ev:nth-child(1):hover) { transform: translate(-5px, -5px) rotateX(-10deg) rotateY(10deg); } .card:has(.ev:nth-child(2):hover) { transform: translate(0px, -5px) rotateX(-10deg) rotateY(0deg); } .card:has(.ev:nth-child(3):hover) { transform: translate(5px, -5px) rotateX(-10deg) rotateY(-10deg); } .card:has(.ev:nth-child(4):hover) { transform: translate(-5px, 0px) rotateX(0deg) rotateY(10deg); } .card:has(.ev:nth-child(5):hover) { transform: translate(0px, 0px) rotateX(1deg) rotateY(1deg); } .card:has(.ev:nth-child(6):hover) { transform: translate(5px, 0px) rotateX(0deg) rotateY(-10deg); } .card:has(.ev:nth-child(7):hover) { transform: translate(-5px, 5px) rotateX(10deg) rotateY(10deg); } .card:has(.ev:nth-child(8):hover) { transform: translate(0px, 5px) rotateX(10deg) rotateY(0deg); } .........完整代码请登录后点击上方下载按钮下载查看
网友评论0