Advertisement
Guest User

Untitled

a guest
Aug 1st, 2015
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.44 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Красивые градиентные кнопки без картинок для всех браузеров</title>
  6. <style>
  7. body {
  8. background: #e5e5e5;
  9. text-align: center;
  10. }
  11.  
  12. /*----------------------------*/
  13.  
  14. .button {
  15. margin: 10px;
  16. text-decoration: none;
  17. font: bold 1.5em 'Trebuchet MS',Arial, Helvetica; /* Изменяйте em для масштабирования кнопки */
  18. display: inline-block;
  19. text-align: center;
  20. color: #fff;
  21.  
  22. border: 1px solid #9c9c9c; /* Запасной стиль */
  23. border: 1px solid rgba(0, 0, 0, 0.3);
  24.  
  25. text-shadow: 0 1px 0 rgba(0,0,0,0.4);
  26.  
  27. box-shadow: 0 0 .05em rgba(0,0,0,0.4);
  28. -moz-box-shadow: 0 0 .05em rgba(0,0§,0,0.4);
  29. -webkit-box-shadow: 0 0 .05em rgba(0,0,0,0.4);
  30. }
  31.  
  32. .button, .button span {
  33. -moz-border-radius: .3em;
  34. border-radius: .3em;
  35. }
  36.  
  37. .button span {
  38. border-top: 1px solid #fff; /* Fallback style */
  39. border-top: 1px solid rgba(255, 255, 255, 0.5);
  40. display: block;
  41. padding: 0.5em 2.5em;
  42.  
  43. /* Фоновый паттерн */
  44.  
  45. background-image: -webkit-gradient(linear, 0 0, 100% 100%, color-stop(.25, rgba(0, 0, 0, 0.05)), color-stop(.25, transparent), to(transparent)),
  46. -webkit-gradient(linear, 0 100%, 100% 0, color-stop(.25, rgba(0, 0, 0, 0.05)), color-stop(.25, transparent), to(transparent)),
  47. -webkit-gradient(linear, 0 0, 100% 100%, color-stop(.75, transparent), color-stop(.75, rgba(0, 0, 0, 0.05))),
  48. -webkit-gradient(linear, 0 100%, 100% 0, color-stop(.75, transparent), color-stop(.75, rgba(0, 0, 0, 0.05)));
  49. background-image: -moz-linear-gradient(45deg, rgba(0, 0, 0, 0.05) 25%, transparent 25%, transparent),
  50. -moz-linear-gradient(-45deg, rgba(0, 0, 0, 0.05) 25%, transparent 25%, transparent),
  51. -moz-linear-gradient(45deg, transparent 75%, rgba(0, 0, 0, 0.05) 75%),
  52. -moz-linear-gradient(-45deg, transparent 75%, rgba(0, 0, 0, 0.05) 75%);
  53.  
  54. /* Настройки паттерна */
  55.  
  56. -moz-background-size: 3px 3px;
  57. -webkit-background-size: 3px 3px;
  58. }
  59.  
  60. .button:hover {
  61. box-shadow: 0 0 .1em rgba(0,0,0,0.4);
  62. -moz-box-shadow: 0 0 .1em rgba(0,0,0,0.4);
  63. -webkit-box-shadow: 0 0 .1em rgba(0,0,0,0.4);
  64. }
  65.  
  66. .button:active {
  67. /* Опускаем на 1px при нажатии */
  68. position: relative;
  69. top: 1px;
  70. }
  71.  
  72. /*----------------------------*/
  73.  
  74. .button-khaki {
  75. background: #A2B598;
  76. background: -webkit-gradient(linear, left top, left bottom, from(#BDD1B4), to(#A2B598) );
  77. background:-moz-linear-gradient(-90deg, #BDD1B4, #A2B598);
  78. filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#BDD1B4', EndColorStr='#A2B598');
  79. }
  80.  
  81. .button-khaki:hover {
  82. background: #BDD1B4;
  83. background: -webkit-gradient(linear, left top, left bottom, from(#A2B598), to(#BDD1B4) );
  84. background: -moz-linear-gradient(-90deg, #A2B598, #BDD1B4);
  85. filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#A2B598', EndColorStr='#BDD1B4');
  86. }
  87.  
  88. .button-khaki:active {
  89. background: #A2B598;
  90. }
  91.  
  92. /*----------------------------*/
  93.  
  94. .button-blue {
  95. background: #4477a1;
  96. background: -webkit-gradient(linear, left top, left bottom, from(#81a8cb), to(#4477a1) );
  97. background: -moz-linear-gradient(-90deg, #81a8cb, #4477a1);
  98. filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#81a8cb', endColorstr='#4477a1');
  99. }
  100.  
  101. .button-blue:hover {
  102. background: #81a8cb;
  103. background: -webkit-gradient(linear, left top, left bottom, from(#4477a1), to(#81a8cb) );
  104. background: -moz-linear-gradient(-90deg, #4477a1, #81a8cb);
  105. filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#4477a1', endColorstr='#81a8cb');
  106. }
  107.  
  108. .button-blue:active {
  109. background: #4477a1;
  110. }
  111.  
  112. /*----------------------------*/
  113.  
  114. .button-brown {
  115. background: #8f3714;
  116. background: -webkit-gradient(linear, left top, left bottom, from(#bf6f50), to(#8f3714) );
  117. background: -moz-linear-gradient(-90deg, #bf6f50, #8f3714);
  118. filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#bf6f50', EndColorStr='#8f3714');
  119. }
  120.  
  121. .button-brown:hover {
  122. background: #bf6f50;
  123. background: -webkit-gradient(linear, left top, left bottom, from(#8f3714), to(#bf6f50) );
  124. background: -moz-linear-gradient(-90deg, #8f3714, #bf6f50);
  125. filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#8f3714', EndColorStr='#bf6f50');
  126. }
  127.  
  128. .button-brown:active {
  129. background: #8f3714;
  130. }
  131.  
  132. /*----------------------------*/
  133.  
  134. .button-green {
  135. background: #428739;
  136. background: -webkit-gradient(linear, left top, left bottom, from(#c8dd95), to(#428739) );
  137. background: -moz-linear-gradient(-90deg, #c8dd95, #428739);
  138. filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#c8dd95', EndColorStr='#428739');
  139. }
  140.  
  141. .button-green:hover {
  142. background: #c8dd95;
  143. background: -webkit-gradient(linear, left top, left bottom, from(#428739), to(#c8dd95) );
  144. background: -moz-linear-gradient(-90deg, #428739, #c8dd95);
  145. filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#428739', EndColorStr='#c8dd95');
  146. }
  147.  
  148. .button-green:active {
  149. background: #428739;
  150. }
  151.  
  152. /*----------------------------*/
  153.  
  154. .button-red {
  155. background: #D82741;
  156. background: -webkit-gradient(linear, left top, left bottom, from(#E84B6E), to(#D82741) );
  157. background: -moz-linear-gradient(-90deg, #E84B6E, #D82741);
  158. filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#E84B6E', EndColorStr='#D82741');
  159. }
  160.  
  161. .button-red:hover {
  162. background: #E84B6E;
  163. background: -webkit-gradient(linear, left top, left bottom, from(#D82741), to(#E84B6E) );
  164. background: -moz-linear-gradient(-90deg, #D82741, #E84B6E);
  165. filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#D82741', EndColorStr='#E84B6E');
  166. }
  167.  
  168. .button-red:active {
  169. background: #D82741;
  170. }
  171.  
  172. /*----------------------------*/
  173.  
  174. .button-purple {
  175. background: #6F50E7;
  176. background: -webkit-gradient(linear, left top, left bottom, from(#B8A9F3), to(#6F50E7) );
  177. background: -moz-linear-gradient(-90deg, #B8A9F3, #6F50E7);
  178. filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#B8A9F3', EndColorStr='#6F50E7');
  179. }
  180.  
  181. .button-purple:hover {
  182. background: #B8A9F3;
  183. background: -webkit-gradient(linear, left top, left bottom, from(#6F50E7), to(#B8A9F3) );
  184. background: -moz-linear-gradient(-90deg, #6F50E7, #B8A9F3);
  185. filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#6F50E7', EndColorStr='#B8A9F3');
  186. }
  187.  
  188. .button-purple:active {
  189. background: #6F50E7;
  190. }
  191.  
  192. /*----------------------------*/
  193.  
  194. .button-black {
  195. background: #141414;
  196. background: -webkit-gradient(linear, left top, left bottom, from(#656565), to(#141414) );
  197. background: -moz-linear-gradient(-90deg, #656565, #141414);
  198. filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#656565', EndColorStr='#141414');
  199. }
  200.  
  201. .button-black:hover {
  202. background: #656565;
  203. background: -webkit-gradient(linear, left top, left bottom, from(#141414), to(#656565) );
  204. background: -moz-linear-gradient(-90deg, #141414, #656565);
  205. filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#141414', EndColorStr='#656565');
  206. }
  207.  
  208. .button-black:active {
  209. background: #141414;
  210. }
  211.  
  212. /*----------------------------*/
  213.  
  214. .button-orange {
  215. background: #f09c15;
  216. background: -webkit-gradient(linear, left top, left bottom, from(#f8c939), to(#f09c15) );
  217. background: -moz-linear-gradient(-90deg, #f8c939, #f09c15);
  218. filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#f8c939', EndColorStr='#f09c15');
  219. }
  220.  
  221. .button-orange:hover {
  222. background: #f8c939;
  223. background: -webkit-gradient(linear, left top, left bottom, from(#f09c15), to(#f8c939) );
  224. background: -moz-linear-gradient(-90deg, #f09c15, #f8c939);
  225. filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#f09c15', EndColorStr='#f8c939');
  226. }
  227.  
  228. .button-orange:active {
  229. background: #f09c15;
  230. }
  231.  
  232. /*----------------------------*/
  233.  
  234. .button-silver {
  235. background: #c5c5c5;
  236. background: -webkit-gradient(linear, left top, left bottom, from(#eaeaea), to(#c5c5c5) );
  237. background: -moz-linear-gradient(-90deg, #eaeaea, #c5c5c5);
  238. filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#eaeaea', EndColorStr='#c5c5c5');
  239. }
  240.  
  241. .button-silver:hover {
  242. background: #eaeaea;
  243. background: -webkit-gradient(linear, left top, left bottom, from(#c5c5c5), to(#eaeaea) );
  244. background: -moz-linear-gradient(-90deg, #c5c5c5, #eaeaea);
  245. filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#c5c5c5', EndColorStr='#eaeaea');
  246. }
  247.  
  248. .button-silver:active {
  249. background: #c5c5c5;
  250. }
  251. </style>
  252. </head>
  253. <body>
  254. <h1>Красивые градиентные кнопки без картинок для всех браузеров</h1>
  255.  
  256. <a href="#" class="button button-khaki"><span>Button</span></a>
  257. <a href="#" class="button button-blue"><span>Button</span></a>
  258. <a href="#" class="button button-brown"><span>Button</span></a>
  259. <br>
  260. <a href="#" class="button button-red"><span>Button</span></a>
  261. <a href="#" class="button button-purple"><span>Button</span></a>
  262. <a href="#" class="button button-green"><span>Button</span></a>
  263. <br>
  264. <a href="#" class="button button-black"><span>Button</span></a>
  265. <a href="#" class="button button-orange"><span>Button</span></a>
  266. <a href="#" class="button button-silver"><span>Button</span></a>
  267. </body>
  268. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement