iis服务器助手广告广告
返回顶部
首页 > 资讯 > 前端开发 > VUE >怎么用纯CSS3实现动画按钮效果
  • 1056
分享到

怎么用纯CSS3实现动画按钮效果

2024-04-02 19:04:59 1056人浏览 八月长安
摘要

这篇文章主要介绍了怎么用纯css3实现动画按钮效果,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。html代码:<div class=&

这篇文章主要介绍了怎么用纯css3实现动画按钮效果,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。

html代码:

<div class="button01">

      <a href="#">Download</a>

      <p class="top">click to begin</p>

      <p class="bottom">1.2MB .zip</p>

</div>

CSS代码:

.button01 {

  width: 200px;

  margin: 50px auto 20px auto;

}

.button01 a {

  display: block;

  height: 50px;

  width: 200px;

 

  color: white;

  font: 17px/50px Helvetica, Verdana, sans-serif;

  text-decoration: none;

  text-align: center;

  text-transfORM: uppercase;

   

  background: #00b7ea;

  background: -moz-linear-gradient(top, #00b7ea 0%, #009ec3 100%);

  background: -WEBkit-gradient(linear, left top, left bottom, color-stop(0%,#00b7ea), color-stop(100%,#009ec3));

  background: -webkit-linear-gradient(top, #00b7ea 0%,#009ec3 100%);

  background: -o-linear-gradient(top, #00b7ea 0%,#009ec3 100%);

  background: -ms-linear-gradient(top, #00b7ea 0%,#009ec3 100%);

  background: linear-gradient(top, #00b7ea 0%,#009ec3 100%);

  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00b7ea', endColorstr='#009ec3',GradientType=0 );

}

.button01 a, p {

    -webkit-border-radius: 10px;

     -moz-border-radius: 10px;

          border-radius: 10px;

  -webkit-box-shadow: 2px 2px 8px rgba(0,0,0,0.2);

     -moz-box-shadow: 2px 2px 8px rgba(0,0,0,0.2);

          box-shadow: 2px 2px 8px rgba(0,0,0,0.2);

}

p {

  background: #222;

  display: block;

  height: 40px;

  width: 180px; 

  margin: -50px 0 0 10px;

 

  text-align: center;

  font: 12px/45px Helvetica, Verdana, sans-serif;

  color: #fff;

 

  position: absolute;

  z-index: -1;

   

  -webkit-transition: margin 0.5s ease;

     -moz-transition: margin 0.5s ease;

       -o-transition: margin 0.5s ease;

      -ms-transition: margin 0.5s ease;

          transition: margin 0.5s ease;

}

.button01:hover .bottom {

  margin: -10px 0 0 10px;

}

.button01:hover .top {

  margin: -80px 0 0 10px;

  line-height: 35px;

}

.button01 a:active {

 background: #00b7ea;

 background: -moz-linear-gradient(top,  #00b7ea 36%, #009ec3 100%);

 background: -webkit-gradient(linear, left top, left bottom, color-stop(36%,#00b7ea), color-stop(100%,#009ec3));

 background: -webkit-linear-gradient(top,  #00b7ea 36%,#009ec3 100%);

 background: -o-linear-gradient(top,  #00b7ea 36%,#009ec3 100%);

 background: -ms-linear-gradient(top,  #00b7ea 36%,#009ec3 100%);

 background: linear-gradient(top,  #00b7ea 36%,#009ec3 100%);

 filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00b7ea', endColorstr='#009ec3',GradientType=0 );

}

.button01:active .bottom {

  margin: -20px 0 0 10px;

}

.button01:active .top {

  margin: -70px 0 0 10px;

}

感谢你能够认真阅读完这篇文章,希望小编分享的“怎么用纯CSS3实现动画按钮效果”这篇文章对大家有帮助,同时也希望大家多多支持编程网,关注编程网VUE频道,更多相关知识等着你来学习!

--结束END--

本文标题: 怎么用纯CSS3实现动画按钮效果

本文链接: https://www.lsjlt.com/news/89622.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
软考高级职称资格查询
推荐阅读
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作