Hellow,
This will be a very quick and short guide on how to code any button of your liking into real by ONLY using CSS and without slicing as images.
ALL the buttons here are compatible with the following browsers:
IE8+
Chrome
Safari
Opera
Firefox3+
Syntax
Standard
To add linear gradient from top to bottom starting from black and ending with white
background: linear-gradient (top,#000000,#FFFFFF);
Safari 5.1, Chrome 10+
background: -webkit-linear-gradient (top,#000000,#FFFFFF);
Safari 4-5, Chrome 1-9
background: -webkit-gradient (linear,top,bottom, from(#000000), to(#FFFFFF));
Firefox 3.6+
background: -moz-linear-gradient (top,#000000,#FFFFFF);
IE 10+
background: -ms-linear-gradient (top,#000000,#FFFFFF);
Opera 11.10+
background: -o-linear-gradient (top,#000000,#FFFFFF);
Ex:
Type: Linear Gradient
Starting color: #0d66e0
Ending Color: #74a0dc
This will be a very quick and short guide on how to code any button of your liking into real by ONLY using CSS and without slicing as images.
ALL the buttons here are compatible with the following browsers:
IE8+
Chrome
Safari
Opera
Firefox3+
Gradient
Syntax
Standard
To add linear gradient from top to bottom starting from black and ending with white
background: linear-gradient (top,#000000,#FFFFFF);
Safari 5.1, Chrome 10+
background: -webkit-linear-gradient (top,#000000,#FFFFFF);
Safari 4-5, Chrome 1-9
background: -webkit-gradient (linear,top,bottom, from(#000000), to(#FFFFFF));
Firefox 3.6+
background: -moz-linear-gradient (top,#000000,#FFFFFF);
IE 10+
background: -ms-linear-gradient (top,#000000,#FFFFFF);
Opera 11.10+
background: -o-linear-gradient (top,#000000,#FFFFFF);
Ex:
Type: Linear Gradient
Starting color: #0d66e0
Ending Color: #74a0dc
- #btn{
- background: linear-gradient(top, #0d66e0, #74a0dc);
- background: -webkit-gradient(linear,top,bottom,from(#0d66e0),to(#74a0dc));
- background: -webkit-linear-gradient(top, #0d66e0, #74a0dc);
- background: -moz-linear-gradient(top, #0d66e0, #74a0dc);
- background: -ms-linear-gradient(top, #0d66e0, #74a0dc);
- background: -o-linear-gradient(top, #0d66e0, #74a0dc);
- width:150px;
- height:50px;
- color:white;
- text-align:center;
- line-height:45px;
- }
Type: Radial Gradient
Starting color: #474444
Ending Color: #7e7b7b
- #btn2{
- background: radial-gradient(top, #474444, #7e7b7b);
- background: -webkit-gradient(radial,top,bottom,from(#474444),to(#7e7b7b));
- background: -webkit-radial-gradient(top, #474444, #7e7b7b);
- background: -moz-radial-gradient(top, #474444, #7e7b7b);
- background: -ms-radial-gradient(top, #474444, #7e7b7b);
- background: -o-radial-gradient(top, #474444, #7e7b7b);
- width:150px;
- height:50px;
- color:white;
- text-align:center;
- line-height:45px;
- }
Round border
Syntax
Standard
border-radius: 5px;
You can also specify them seperately as
border-radius: 5px 5px 10px 10px;
Safari, Chrome
-webkit-border-radius: 5px;
Firefox
-moz-border-radius: 5px;
Round border : 5px
Border color : #777777
Border width: 2px
Gradient: #cfcfcf -> #e9e9e9
- #btn3{
- background: linear-gradient(top, #cfcfcf, #e9e9e9);
- background: -webkit-gradient(linear,top,bottom,from(#cfcfcf),to(#e9e9e9));
- background: -webkit-linear-gradient(top, #cfcfcf, #e9e9e9);
- background: -moz-linear-gradient(top, #cfcfcf, #e9e9e9);
- background: -ms-linear-gradient(top, #cfcfcf, #e9e9e9);
- background: -o-linear-gradient(top, #cfcfcf, #e9e9e9);
- border:2px solid #777777;
- border-radius:5px;
- -webkit-border-radius:5px;
- -moz-border-radius:5px;
- width:150px;
- height:50px;
- color:#3b3939;
- text-align:center;
- line-height:45px;
- }
Drop Shadow
Syntax
box-shadow: 5px 5px 3px 10px;
this one is a bit tricky, the values are for
box-shadow: horiz-shadow vert-shadow blur spread color inset;
Safari, Chrome
-webkit-box-shadow: 5px 5px 3px 10px;
Firefox
-moz-box-shadow: 5px 5px 3px 10px;
Box Shadow: 0px 0px 5px 0px
Round border : 5px
Border color : #777777
Border width: 2px
Gradient: #cfcfcf -> #e9e9e9
- #btn4{
- background: linear-gradient(top, #cfcfcf, #e9e9e9);
- background: -webkit-gradient(linear,top,bottom,from(#cfcfcf),to(#e9e9e9));
- background: -webkit-linear-gradient(top, #cfcfcf, #e9e9e9);
- background: -moz-linear-gradient(top, #cfcfcf, #e9e9e9);
- background: -ms-linear-gradient(top, #cfcfcf, #e9e9e9);
- background: -o-linear-gradient(top, #cfcfcf, #e9e9e9);
- border:2px solid #777777;
- border-radius:5px;
- -webkit-border-radius:5px;
- -moz-border-radius:5px;
- box-shadow:0px 0px 5px 0px;
- -webkit-box-shadow:0px 0px 5px 0px;
- -moz-box-shadow:0px 0px 5px 0px;
- width:150px;
- height:50px;
- color:#3b3939;
- text-align:center;
- line-height:45px;
- }
No comments:
Post a Comment