富贵资源网 Design By www.hznty.com
今天给大家分享一款纯css3实现的动画按钮。第一排的按钮当鼠标经过的背景色动画切换,图标从右侧飞入,第二排的按钮当鼠标经过的时候边框动画切换,图标右侧飞入,效果非常好,一起看下效果图:
实现的代码。
html代码:
XML/HTML Code复制内容到剪贴板- <div class="black">
- <a href="#" class="btn"><span>Become A Member</span> <i>→</i> </a><a href="#"
- class="btn"><span>Support Us</span> <i>→</i> </a><a href="#" class="btn"><span>
- Going Down</span> <i class="down">→</i> </a><a href="#" class="btn"><span>Sign
- Up</span> <i class="up">→</i> </a>
- </div>
- <div class="white">
- <a href="#" class="btn"><span>Become A Member</span> <i>→</i> </a><a href="#"
- class="btn"><span>Support Us</span> <i>→</i> </a><a href="#" class="btn"><span>
- Going Down</span> <i class="down">→</i> </a><a href="#" class="btn"><span>Sign
- Up</span> <i class="up">→</i> </a>
- </div>
css3代码:
CSS Code复制内容到剪贴板- body
- {
- }
- h1
- {
- font-family: "Abril Titling" , Georgia, serif;
- color: #f9f9f9;
- letter-spacing: 1px;
- }
- body div
- {
- padding: 60px 0;
- text-align: center;
- height: 80px;
- margin-top: 0;
- }
- .black
- {
- background: #262D28;
- }
- .white
- {
- background: #f9f9f9;
- }
- a
- {
- display: inline-block;
- margin: 10px;
- }
- .btn
- {
- position: relative;
- width: 160px;
- padding: 1.2rem 3rem;
- border: 1px solid #0AA944;
- font-size: 15px;
- text-decoration: none;
- color: #f9f9f9;
- font-family: "Tablet Gothic" , sans-serif;
- text-transform: uppercase;
- font-weight: 300;
- letter-spacing: 1.5px;
- -webkit-transition: all .2s ease-out;
- -moz-transition: all .2s ease-out;
- -ms-transition: all .2s ease-out;
- -o-transition: all .2s ease-out;
- transition: all .2s ease-out;
- }
- .white .btn
- {
- color: #262D28;
- border: 2px solid #0AA944;
- }
- .btn span
- {
- position: relative;
- top: 2px;
- left: 0;
- -webkit-transition: all .3s ease-out;
- -moz-transition: all .3s ease-out;
- -ms-transition: all .3s ease-out;
- -o-transition: all .3s ease-out;
- transition: all .3s ease-out;
- }
- .btn i
- {
- opacity: 0;
- position: absolute;
- margin-top: -21px;
- top: 2.5rem;
- left: 120%;
- -webkit-transition: all .3s ease-out;
- -moz-transition: all .3s ease-out;
- -ms-transition: all .3s ease-out;
- -o-transition: all .3s ease-out;
- transition: all .3s ease-out;
- }
- .btn:hover
- {
- background: rgba(255,255,255, .9);
- border: 1px solid rgba(0,0,0,1);
- }
- .white .btn:hover
- {
- background: rgba(0,0,0, .02);
- border: 2px solid rgba(0,0,0,1);
- }
- .btn:hover span
- {
- color: #333;
- left: -20px;
- }
- a.btn:hover i
- {
- opacity: 1;
- left: 80%;
- color: #333;
- -webkit-transform: scale(1.2);
- }
- a.btn:hover .up
- {
- -webkit-transform: rotate(270deg);
- }
- a.btn:hover .down
- {
- -webkit-transform: rotate(90deg);
- }
以上就是今天给大家分享一款纯css3实现的动画按钮的全部代码, 谢谢阅读,希望能帮到大家,请继续关注,我们会努力分享更多优秀的文章。
富贵资源网 Design By www.hznty.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
富贵资源网 Design By www.hznty.com
暂无评论...
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。