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

一款基于css3的动画按钮代码教程

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

  考高分网之前为大家分享了很多款纯css3实现的实用按钮。今天给大家带来一款基于css3的动画按钮。实现的效果图如下:

  实现的代码。

  html代码:

XML/HTML Code复制内容到剪贴板
  1.   
  2.           
  3.               
  4.                   
  5.                     share on twitter   
  6.                 
  
  •             
  •   
  •               
  •                   
  •             
  •   
  •         
  •   
  •           
  •               
  •                   
  •                     share on facebook   
  •                   
  •               
  •               
  •                   
  •               
  •           
  •           
  •               
  •                   
  •                     pin on pinterest   
  •                   
  •               
  •               
  •                   
  •               
  •           
  •           
  •               
  •                   
  •                     share on tumblr   
  •                   
  •               
  •               
  •                   
  •               
  •           
  •           
  •               
  •                   
  •                     share on google+   
  •                   
  •               
  •               
  •                   
  •               
  •           
  •       
  •   css3代码:

    CSS Code复制内容到剪贴板
    1. body   
    2.         {   
    3.             background: -webkit-linear-gradient(0deg, #FF8008 10%, #FFC837 90%);   
    4.             background: linear-gradient(90deg, #FF8008 10%, #FFC837 90%);   
    5.             padding: 2em;   
    6.             text-align: center;   
    7.         }   
    8.            
    9.         *   
    10.         {   
    11.             -moz-box-sizing: border-box;   
    12.             box-sizing: border-box;   
    13.         }   
    14.            
    15.         .share-buttons   
    16.         {   
    17.             position: absolute;   
    18.             width: 300px;   
    19.             height: 212px;   
    20.             padding-left: 135px;   
    21.             top: 50%;   
    22.             left: 50%;   
    23.             margin-left: -150px;   
    24.             margin-top: -106px;   
    25.         }   
    26.         .share-buttons .share-button   
    27.         {   
    28.             float: left;   
    29.             margin-top: 15px;   
    30.         }   
    31.         .share-buttons .share-button:first-child   
    32.         {   
    33.             margin-top: 0;   
    34.         }   
    35.         .share-buttons .share-button:after   
    36.         {   
    37.             clear: both;   
    38.             display: table;   
    39.         }   
    40.            
    41.         .share-button   
    42.         {   
    43.             display: block;   
    44.             position: relative;   
    45.             height: 30px;   
    46.         }   
    47.         .share-button:hover   
    48.         {   
    49.             cursor: pointer;   
    50.         }   
    51.         .share-button:hover .share-button-primary   
    52.         {   
    53.             box-shadow: 1px 0 0 0 rgba(0, 0, 0, 0.1);   
    54.         }   
    55.         .share-button:hover .share-button-secondary-content  
    56.         {   
    57.             -webkit-transform: translate3d(0, 0, 0);   
    58.             transform: translate3d(0, 0, 0);   
    59.         }   
    60.            
    61.         .share-button-primary   
    62.         {   
    63.             position: absolute;   
    64.             background: #fff;   
    65.             width: 30px;   
    66.             height: 30px;   
    67.             border-radius: 15px;   
    68.             left: 0;   
    69.             top: 50%;   
    70.             margin-top: -15px;   
    71.         }   
    72.            
    73.         .share-button-icon  
    74.         {   
    75.             display: block;   
    76.             color: #242424;   
    77.             position: absolute;   
    78.             width: 30px;   
    79.             line-height: 30px;   
    80.             font-size: 16px;   
    81.             margin-top: 1px;   
    82.         }   
    83.            
    84.         .share-button-secondary   
    85.         {   
    86.             overflow: hidden;   
    87.             margin-left: 15px;   
    88.             height: 30px;   
    89.         }   
    90.            
    91.         .share-button-secondary-content  
    92.         {   
    93.             font-family: sans-serif;   
    94.             font-size: .75em;   
    95.             background: #fff;   
    96.             display: block;   
    97.             height: 30px;   
    98.             text-align: left;   
    99.             padding-left: 24px;   
    100.             padding-right: 18px;   
    101.             line-height: 30px;   
    102.             color: #242424;   
    103.             border-radius: 0 15px 15px 0;   
    104.             -webkit-transform: translate3d(-100%, 0, 0);   
    105.             transform: translate3d(-100%, 0, 0);   
    106.             -webkit-transition: -webkit-transform 175ms ease;   
    107.             transition: transform 175ms ease;   
    108.         }  
    109.   

     相关推荐:

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

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

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

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

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

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

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

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

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

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

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