栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > Web开发 > Html/CSS > CSS教程

五款漂亮的纯CSS3动画按钮的实例教程

CSS教程 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

  今天来分享很不错的CSS3按钮动画,这款CSS3按钮一共有5种动画方式,每一种都是鼠标滑过动画形式,虽然这些动画按钮不是十分华丽,但是小编觉得不像其他按钮那样很难扩展,我们可以修改CSS代码随意改变自己喜欢的颜色样式。

  让我们一起来看看实现这5中样式动画按钮的HTML代码和CSS代码吧。以第一个按钮为例,其他按钮的代码大家可以下载源代码来研究,并不是很难。

  HTML代码:

XML/HTML Code复制内容到剪贴板
  1.   
  2.       Download  
  3.       click to begin

      
  4.       1.2MB .zip

      
  

  CSS代码:

CSS Code复制内容到剪贴板
  1. .button01 {   
  2.   width: 200px;   
  3.   margin: 50px auto 20px auto;   
  4. }   
  5.   
  6. .button01 a {   
  7.   display: block;   
  8.   height: 50px;   
  9.   width: 200px;   
  10.   
  11.     
  12.   color: white;   
  13.   font: 17px/50px Helvetica, Verdana, sans-serif;   
  14.   text-decoration: none;   
  15.   text-align: center;   
  16.   text-transform: uppercase;   
  17.   
  18.        
  19.   background: #00b7ea;   
  20.   background: -moz-linear-gradient(top, #00b7ea 0%, #009ec3 100%);   
  21.   background: -webkit-gradient(linear, left top, left bottombottom, color-stop(0%,#00b7ea), color-stop(100%,#009ec3));   
  22.   background: -webkit-linear-gradient(top, #00b7ea 0%,#009ec3 100%);   
  23.   background: -o-linear-gradient(top, #00b7ea 0%,#009ec3 100%);   
  24.   background: -ms-linear-gradient(top, #00b7ea 0%,#009ec3 100%);   
  25.   background: linear-gradient(top, #00b7ea 0%,#009ec3 100%);   
  26.   filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00b7ea', endColorstr='#009ec3',GradientType=0 );   
  27. }   
  28.   
  29. .button01 a, p {   
  30.     -webkit-border-radius: 10px;   
  31.      -moz-border-radius: 10px;   
  32.           border-radius: 10px;   
  33.   
  34.   -webkit-box-shadow: 2px 2px 8px rgba(0,0,0,0.2);   
  35.      -moz-box-shadow: 2px 2px 8px rgba(0,0,0,0.2);   
  36.           box-shadow: 2px 2px 8px rgba(0,0,0,0.2);   
  37. }   
  38.   
  39. p {   
  40.   background: #222;   
  41.   display: block;   
  42.   height: 40px;   
  43.   width: 180px;    
  44.   margin: -50px 0 0 10px;   
  45.   
  46.     
  47.   text-align: center;   
  48.   font: 12px/45px Helvetica, Verdana, sans-serif;   
  49.   color: #fff;   
  50.   
  51.     
  52.   position: absolute;   
  53.   z-index: -1;   
  54.   
  55.        
  56.   -webkit-transition: margin 0.5s ease;   
  57.      -moz-transition: margin 0.5s ease;   
  58.        -o-transition: margin 0.5s ease;   
  59.       -ms-transition: margin 0.5s ease;   
  60.           transition: margin 0.5s ease;   
  61. }   
  62.   
  63.   
  64. .button01:hover .bottombottom {   
  65.   margin: -10px 0 0 10px;   
  66. }   
  67.   
  68. .button01:hover .top {   
  69.   margin: -80px 0 0 10px;   
  70.   line-height: 35px;   
  71. }   
  72.   
  73.   
  74. .button01 a:active {   
  75.       background: #00b7ea;   
  76.       background: -moz-linear-gradient(top,  #00b7ea 36%, #009ec3 100%);   
  77.       background: -webkit-gradient(linear, left top, left bottombottom, color-stop(36%,#00b7ea), color-stop(100%,#009ec3));   
  78.       background: -webkit-linear-gradient(top,  #00b7ea 36%,#009ec3 100%);   
  79.       background: -o-linear-gradient(top,  #00b7ea 36%,#009ec3 100%);   
  80.       background: -ms-linear-gradient(top,  #00b7ea 36%,#009ec3 100%);   
  81.       background: linear-gradient(top,  #00b7ea 36%,#009ec3 100%);   
  82.       filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00b7ea', endColorstr='#009ec3',GradientType=0 );   
  83.   
  84. }   
  85.   
  86. .button01:active .bottombottom {   
  87.   margin: -20px 0 0 10px;   
  88. }   
  89.   
  90. .button01:active .top {   
  91.   margin: -70px 0 0 10px;   
  92. }  

 相关推荐:

  纯css3实现的动画按钮的实例教程

  一款纯css3实现的颜色渐变按钮的代码教程

  一款纯css3实现的鼠标经过按钮特效教程

  利用css3实现的简单的鼠标悬停按钮

  纯CSS3发光分享按钮的实现教程

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/216534.html

CSS教程相关栏目本月热门文章

我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号