用HTML & CSS 制作超炫的分享转发按钮-【网页前端设计】cid1030
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" dir="ltr"> <head> <meta charset="utf-8"> <title></title> <link rel="stylesheet" href="style.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.css"> </head> <body> <div class="share-button"> <span><i class="fas fa-share-alt"></i> Share!</span> <a href="#"><i class="fab fa-facebook-f"></i></a> <a href="#"><i class="fab fa-twitter"></i></a> <a href="#"><i class="fab fa-instagram"></i></a> <a href="#"><i class="fab fa-linkedin-in"></i></a> </div> </body> </html>
style.css
body{ margin: 0; padding: 0; font-family: "montserrat",sans-serif; background: #f1f1f1; display: flex; height: 100vh; align-items: center; justify-content: center; } .share-button{ width: 280px; height: 80px; background: #dfe6e9; border-radius: 40px; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; cursor: pointer; transition: .3s linear; } .share-button:hover{ transform: scale(1.1); } .share-button span{ position: absolute; width: 100%; height: 100%; background: #2d3436; color: #f1f1f1; text-align: center; line-height: 80px; z-index: 999; transition: .6s linear; border-radius: 40px; } .share-button:hover span{ transform: translateX(-100%); transition-delay: .3s; } .share-button a{ flex: 1; font-size: 26px; color: #2d3436; text-align: center; transform: translateX(-100%); opacity: 0; transition: 0.3s linear; } .share-button:hover a{ opacity: 1; transform: translateX(0); } .share-button a:nth-of-type(1){ transition-delay: 1s; } .share-button a:nth-of-type(2){ transition-delay: 0.8s; } .share-button a:nth-of-type(3){ transition-delay: 0.6s; } .share-button a:nth-of-type(4){ transition-delay: 0.4s; }
一键获取本网站前端代码设计的所有源码
获取资源构建和完善自己的源码库
源码可以在本地直接演示
同时研究和体验 如何将一些具体的想法的实现过程
源码可以直接嫁接到自己的网站里复用
稍作修改成为自己的作品