HTML CSS js 实现照片册悬停效果cid1038-网页前端设计
Warning: Undefined property: stdClass::$maxbutton id="5" in /www/wwwroot/code.5g-o.com/wp-content/plugins/kama-clic-counter/class.KCCounter.php on line 733
index.html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>creative hover effect</title> <style> .container{ display: flex; width: 100%; padding: 4% 2%; box-sizing: border-box; height: 100vh; } .box{ flex: 1; overflow: hidden; transition: 0.5s; margin: 0 2%; box-shadow: 0 20px 30px rgba(0,0,0,0.1); line-height: 0; } .box > img{ width: 200%; height: calc(100% - 10vh); object-fit: cover; transition: 0.5s; } .box > span{ font-size: 3vh; display: block; text-align: center; height: 10vh; line-height: 2.5; font-family: tahoma; color: #333; text-transform: uppercase; } .box:hover{ flex: 1 1 50%; } .box:hover > img{ width: 100%; height: 100%; } </style> </head> <body> <div class="container"> <div class="box"> <img src="h1.JPG" alt=""> <span>css</span> </div> <div class="box"> <img src="h2.JPG" alt=""> <span>creative</span> </div> <div class="box"> <img src="h3.JPG" alt=""> <span>hover</span> </div> <div class="box"> <img src="girl-1561989_1920.jpg" alt=""> <span>hover</span> </div> </div> </body> </html>
?在线演示?
一键获取本网站前端代码设计的所有源码
获取资源构建和完善自己的源码库
源码可以在本地直接演示
同时研究和体验 如何将一些具体的想法的实现过程
源码可以直接嫁接到自己的网站里复用
稍作修改成为自己的作品