感谢各位肯将自己源码公开的大神~~~- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <title>Demo: CSS3 Buttons</title>
- <style type="text/css">
- body {
- background: #ededed;
- width: 900px;
- margin: 30px auto;
- color: #999;
- }
- p {
- margin: 0 0 2em;
- }
- h1 {
- margin: 0;
- }
- a {
- color: #339;
- text-decoration: none;
- }
- a:hover {
- text-decoration: underline;
- }
- div {
- padding: 20px 0;
- border-bottom: solid 1px #ccc;
- }
-
- /* button
- ---------------------------------------------- */
- .button {
- display: inline-block;
- zoom: 1; /* zoom and *display = ie7 hack for display:inline-block */
- *display: inline;
- vertical-align: baseline;
- margin: 0 2px;
- outline: none;
- cursor: pointer;
- text-align: center;
- text-decoration: none;
- font: 14px/100% Arial, Helvetica, sans-serif;
- padding: .5em 2em .55em;
- text-shadow: 0 1px 1px rgba(0,0,0,.3);
- -webkit-border-radius: .5em;
- -moz-border-radius: .5em;
- border-radius: .5em;
- -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.2);
- -moz-box-shadow: 0 1px 2px rgba(0,0,0,.2);
- box-shadow: 0 1px 2px rgba(0,0,0,.2);
- }
- .button:hover {
- text-decoration: none;
- }
- .button:active {
- position: relative;
- top: 1px;
- }
-
- .bigrounded {
- -webkit-border-radius: 2em;
- -moz-border-radius: 2em;
- border-radius: 2em;
- }
- .medium {
- font-size: 12px;
- padding: .4em 1.5em .42em;
- }
- .small {
- font-size: 11px;
- padding: .2em 1em .275em;
- }
-
- /* color styles
- ---------------------------------------------- */
-
- /* black */
- .black {
- color: #d7d7d7;
- border: solid 1px #333;
- background: #333;
- background: -webkit-gradient(linear, left top, left bottom, from(#666), to(#000));
- background: -moz-linear-gradient(top, #666, #000);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#666666', endColorstr='#000000');
- }
- .black:hover {
- background: #000;
- background: -webkit-gradient(linear, left top, left bottom, from(#444), to(#000));
- background: -moz-linear-gradient(top, #444, #000);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#444444', endColorstr='#000000');
- }
- .black:active {
- color: #666;
- background: -webkit-gradient(linear, left top, left bottom, from(#000), to(#444));
- background: -moz-linear-gradient(top, #000, #444);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#000000', endColorstr='#666666');
- }
-
- /* gray */
- .gray {
- color: #e9e9e9;
- border: solid 1px #555;
- background: #6e6e6e;
- background: -webkit-gradient(linear, left top, left bottom, from(#888), to(#575757));
- background: -moz-linear-gradient(top, #888, #575757);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#888888', endColorstr='#575757');
- }
- .gray:hover {
- background: #616161;
- background: -webkit-gradient(linear, left top, left bottom, from(#757575), to(#4b4b4b));
- background: -moz-linear-gradient(top, #757575, #4b4b4b);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#757575', endColorstr='#4b4b4b');
- }
- .gray:active {
- color: #afafaf;
- background: -webkit-gradient(linear, left top, left bottom, from(#575757), to(#888));
- background: -moz-linear-gradient(top, #575757, #888);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#575757', endColorstr='#888888');
- }
-
- /* white */
- .white {
- color: #606060;
- border: solid 1px #b7b7b7;
- background: #fff;
- background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#ededed));
- background: -moz-linear-gradient(top, #fff, #ededed);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#ededed');
- }
- .white:hover {
- background: #ededed;
- background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#dcdcdc));
- background: -moz-linear-gradient(top, #fff, #dcdcdc);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#dcdcdc');
- }
- .white:active {
- color: #999;
- background: -webkit-gradient(linear, left top, left bottom, from(#ededed), to(#fff));
- background: -moz-linear-gradient(top, #ededed, #fff);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#ffffff');
- }
-
- /* orange */
- .orange {
- color: #fef4e9;
- border: solid 1px #da7c0c;
- background: #f78d1d;
- background: -webkit-gradient(linear, left top, left bottom, from(#faa51a), to(#f47a20));
- background: -moz-linear-gradient(top, #faa51a, #f47a20);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#faa51a', endColorstr='#f47a20');
- }
- .orange:hover {
- background: #f47c20;
- background: -webkit-gradient(linear, left top, left bottom, from(#f88e11), to(#f06015));
- background: -moz-linear-gradient(top, #f88e11, #f06015);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f88e11', endColorstr='#f06015');
- }
- .orange:active {
- color: #fcd3a5;
-