*新闻详情页*/>
CSS 完成 照片电脑鼠标悬停折叠实际效果
1. 完成关键点
2. 实际效果展现
3. 源代码
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>hover-folder</title> <style> html, body, ul, li { margin: 0; padding: 0 } ul { list-style: none; display: block; } body { width: 100%; height: 100vh; } .container { width: 100%; height: 100%; /* background-color: aqua; */ display: flex; justify-content: center; align-items: center; transform: scale(0.5); } .wrap { box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .5); width: 1280px; height: 854px; font-size: 0; line-height: 0; position: relative; } .image { cursor: pointer; } .abs-wrap { height: 100%; width: 100%; /* top: 0; left: 0; */ /* position: absolute; */ z-index: 10; } .abs-wrap:hover>.abs:nth-child(2) { transform: matrix(0.8, -0.2, 0, 1, -1, 0); } .abs-wrap:hover>.abs:nth-child(3) { transform: matrix(0.8, 0.2, 0, 1, -53, -50); } .abs-wrap:hover>.abs:nth-child(4) { transform: matrix(0.8, -0.2, 0, 1, -105, 0); } .abs-wrap:hover>.abs:nth-child(5) { transform: matrix(0.8, 0.2, 0, 1, -157, -50); } .abs { transform-style: preserve-3d; transform-origin: left center; transition: .4s ease-in-out; width: 20%; height: 100%; /* background-color: rgba(0, 0, 0, .5); */ display: inline-block; background-size: 100%; background: url('https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=15&di=d2979a54604ecb409e3329527d0220fa&imgtype=0&src=http%3A%2F%2Ft9.baidu.com%2Fit%2Fu%三d29311073%2C358824429%26fm%三d79%26app%三d86%26f%三dJPEG%3Fw%三d1280%26h%三d854'); } .abs:nth-child(1) { background-position: 0% 0%; } .abs:nth-child(2) { background-position: 25% 0%; } .abs:nth-child(3) { background-position: 50% 0%; } .abs:nth-child(4) { background-position: 75% 0%; } .abs:nth-child(5) { background-position: 100% 0%; } </style> </head> <body> <div class="container"> <div class="wrap"> <ul class="abs-wrap"> <li class="abs"></li> <li class="abs"></li> <li class="abs"></li> <li class="abs"></li> <li class="abs"></li> </ul> </div> </div> </body> </html>
小结
到此这篇有关CSS 完成 照片电脑鼠标悬停折叠实际效果的文章内容就详细介绍到这了,大量有关css照片电脑鼠标悬停折叠內容请检索脚本制作之家之前的文章内容或再次访问下边的有关文章内容,期待大伙儿之后多多的适用脚本制作之家!
Copyright © 2002-2020 制作小程序_小程序商城_扫码点餐小程序_微信小程序开店的步骤_牛刀小程序 版权所有 (网站地图) 粤ICP备10235580号