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

在岁月中跋涉,每个人都有自己的故事,看淡心境才会秀丽,看开心情才会明媚。累时歇一歇,随清风漫舞,烦时静一静,与花草凝眸,急时缓一缓,和自己微笑。

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

  实现的代码。

  html代码:

XML/HTML Code复制内容到剪贴板
  1. <divclass="share-buttons">
  2. <divclass="share-button">
  3. <divclass="share-button-secondary">
  4. <divclass="share-button-secondary-content">
  5. shareontwitter
  6. </div>
  7. </div>
  8. <divclass="share-button-primary">
  9. <iclass="share-button-iconfafa-twitter"></i>
  10. </div>
  11. </div>
  12. <divclass="share-button">
  13. <divclass="share-button-secondary">
  14. <divclass="share-button-secondary-content">
  15. shareonfacebook
  16. </div>
  17. </div>
  18. <divclass="share-button-primary">
  19. <iclass="share-button-iconfafa-facebook"></i>
  20. </div>
  21. </div>
  22. <divclass="share-button">
  23. <divclass="share-button-secondary">
  24. <divclass="share-button-secondary-content">
  25. pinonpinterest
  26. </div>
  27. </div>
  28. <divclass="share-button-primary">
  29. <iclass="share-button-iconfafa-pinterest"></i>
  30. </div>
  31. </div>
  32. <divclass="share-button">
  33. <divclass="share-button-secondary">
  34. <divclass="share-button-secondary-content">
  35. shareontumblr
  36. </div>
  37. </div>
  38. <divclass="share-button-primary">
  39. <iclass="share-button-iconfafa-tumblr"></i>
  40. </div>
  41. </div>
  42. <divclass="share-button">
  43. <divclass="share-button-secondary">
  44. <divclass="share-button-secondary-content">
  45. shareongoogle+
  46. </div>
  47. </div>
  48. <divclass="share-button-primary">
  49. <iclass="share-button-iconfafa-google-plus"></i>
  50. </div>
  51. </div>
  52. </div>

  css3代码:

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

 相关推荐:

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

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

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

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

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

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

本文一款基于css3的动画按钮代码好代码教程到此结束。不要忘记为自己,为爱自己的人而活……小编再次感谢大家对我们的支持!