当前位置:   article > 正文

button 样式_(收藏)漂亮的css button样式汇总

button样式
  • 在网页设计过程中,程序员们常常需要配合美工来设计页面的美观效果,当然大部分页面风格都是美工的工作。但是按钮button样式,是我们程序员最常用的。
  • 下面我们就给大家介绍一些好看的button样式,大家可以直接复制代码在本地查看效果。这里的button样式没有使用任何图片,可以直接复制代码就可以了!
web前端学习:打造全网web前端全栈资料库(总目录)看完学的更快,掌握的更加牢固,你值得拥有(持续更新)​zhuanlan.zhihu.com

——注:源码里面使用了多种html标签做成按钮,有a,input,span,div,p,h3。总有适合你的标签

button样式源码如下:

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  5. <title>Demo: CSS3 Buttons</title>
  6. <style type="text/css">
  7. body {
  8. background: #ededed;
  9. width: 900px;
  10. margin: 30px auto;
  11. color: #999;
  12. }
  13. p {
  14. margin: 0 0 2em;
  15. }
  16. h1 {
  17. margin: 0;
  18. }
  19. a {
  20. color: #339;
  21. text-decoration: none;
  22. }
  23. a:hover {
  24. text-decoration: underline;
  25. }
  26. div {
  27. padding: 20px 0;
  28. border-bottom: solid 1px #ccc;
  29. }
  30. /* button
  31. ---------------------------------------------- */
  32. .button {
  33. display: inline-block;
  34. zoom: 1; /* zoom and *display = ie7 hack for display:inline-block */
  35. *display: inline;
  36. vertical-align: baseline;
  37. margin: 0 2px;
  38. outline: none;
  39. cursor: pointer;
  40. text-align: center;
  41. text-decoration: none;
  42. font: 14px/100% Arial, Helvetica, sans-serif;
  43. padding: .5em 2em .55em;
  44. text-shadow: 0 1px 1px rgba(0,0,0,.3);
  45. -webkit-border-radius: .5em;
  46. -moz-border-radius: .5em;
  47. border-radius: .5em;
  48. -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.2);
  49. -moz-box-shadow: 0 1px 2px rgba(0,0,0,.2);
  50. box-shadow: 0 1px 2px rgba(0,0,0,.2);
  51. }
  52. .button:hover {
  53. text-decoration: none;
  54. }
  55. .button:active {
  56. position: relative;
  57. top: 1px;
  58. }
  59. .bigrounded {
  60. -webkit-border-radius: 2em;
  61. -moz-border-radius: 2em;
  62. border-radius: 2em;
  63. }
  64. .medium {
  65. font-size: 12px;
  66. padding: .4em 1.5em .42em;
  67. }
  68. .small {
  69. font-size: 11px;
  70. padding: .2em 1em .275em;
  71. }
  72. /* color styles
  73. ---------------------------------------------- */
  74. /* black */
  75. .black {
  76. color: #d7d7d7;
  77. border: solid 1px #333;
  78. background: #333;
  79. background: -webkit-gradient(linear, left top, left bottom, from(#666), to(#000));
  80. background: -moz-linear-gradient(top, #666, #000);
  81. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#666666', endColorstr='#000000');
  82. }
  83. .black:hover {
  84. background: #000;
  85. background: -webkit-gradient(linear, left top, left bottom, from(#444), to(#000));
  86. background: -moz-linear-gradient(top, #444, #000);
  87. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#444444', endColorstr='#000000');
  88. }
  89. .black:active {
  90. color: #666;
  91. background: -webkit-gradient(linear, left top, left bottom, from(#000), to(#444));
  92. background: -moz-linear-gradient(top, #000, #444);
  93. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#000000', endColorstr='#666666');
  94. }
  95. /* gray */
  96. .gray {
  97. color: #e9e9e9;
  98. border: solid 1px #555;
  99. background: #6e6e6e;
  100. background: -webkit-gradient(linear, left top, left bottom, from(#888), to(#575757));
  101. background: -moz-linear-gradient(top, #888, #575757);
  102. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#888888', endColorstr='#575757');
  103. }
  104. .gray:hover {
  105. background: #616161;
  106. background: -webkit-gradient(linear, left top, left bottom, from(#757575), to(#4b4b4b));
  107. background: -moz-linear-gradient(top, #757575, #4b4b4b);
  108. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#757575', endColorstr
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/302538
推荐阅读
相关标签
  

闽ICP备14008679号