Creating Some Impressive Buttons Using CSS

Introduction

 
These days creating buttons using CSS is one of the best web design techniques around. There are many examples and tutorials available on the internet. At present, designers are eliminating background images from buttons and using CSS for creating beautiful buttons. In this article, you'll learn how to create five beautiful CSS based buttons that you can use where ever you want. Now let's design our CSS based buttons.
 

1. BoxCuttor Button

 
First, put this HTML code in your body tag:
  1. <body>  
  2.     <form id="form1" runat="server">  
  3.         <div>  
  4.             <a href="#" class="csharp">C# Sharp</a><br />  
  5.         </div>  
  6.     </form>  
  7. </body> 
Now put some CSS in a style sheet
 
csharp {
 
1. Put some Shadow:
  1. -moz-box-shadow: inset 0px 0px 0px 0px #f9eca0;  
  2. -webkit-box-shadow: inset 0px 0px 0px 0px #f9eca0;  
  3. box-shadow: inset 0px 0px 0px 0px #f9eca0;  
2. Now provide some background effect:
  1. background: -webkit-gradient( linear, left top, left bottom, color-stop(0.05, #f0c911), color-stop(1, #f2ab1e) );  
  2. background: -moz-linear-gradient( center top, #f0c911 5%, #f2ab1e 100% );  
  3. background-color: #f0c911; 
3. Provide some border radius in all sides:
  1. -webkit-border-top-left-radius: 42px;  
  2. -moz-border-radius-topleft: 42px;  
  3. border-top-left-radius: 42px;  
  4.   
  5. -webkit-border-top-right-radius: 0px;  
  6. -moz-border-radius-topright: 0px;  
  7. border-top-right-radius: 0px;  
  8.   
  9. -webkit-border-bottom-right-radius: 42px;  
  10. -moz-border-radius-bottomright: 42px;  
  11. border-bottom-right-radius: 42px;  
  12.   
  13. -webkit-border-bottom-left-radius: 0px;  
  14. -moz-border-radius-bottomleft: 0px;  
  15. border-bottom-left-radius: 0px; 
4. Some simple CSS code:
  1.     text-indent: 0px;  
  2.     border: 3px solid #e65f44;  
  3.     display: inline-block;  
  4.     color: #c92200;  
  5.     font-family: Arial;  
  6.     font-size: 18px;  
  7.     font-weight: bold;  
  8.     font-style: normal;  
  9.     height: 59px;  
  10.     line-height: 59px;  
  11.     width: 133px;  
  12.     text-decoration: none;  
  13.     text-align: center;  
  14.     text-shadow: 0px 0px 0px #ded17c;  
5. Now give some hover effect for our buttons:
  1. .csharp:hover {  
  2.     background: -webkit-gradient( linear, left top, left bottom, color-stop(0.05, #f2ab1e), color-stop(1, #f0c911) );  
  3.     background: -moz-linear-gradient( center top, #f2ab1e 5%, #f0c911 100% );  
  4.     background-color: #f2ab1e;  
6. Finally, give some effect for when the button is active:
  1. .csharp:active {  
  2.     position: relative;  
  3.     top: 1px;  
Output
 
1.PNG
 

2. Button With Icon

 
HTML Code
  1. <div>  
  2.     <a class="button2 iconImg call" href="#"><span>Call Now!</span></a><br /><br />  
  3. </div> 
First put this HTML code in your body tag
 
CSS Code
 
In this portion of code, we create our basic button design without any effect
  1. a.button2 {  
  2.     border: 1px solid #fff;  
  3.     -webkit-box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.5);  
  4.     box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.4);  
  5.     -moz-box-shadow: 1px 1px 5px rgba(1, 1, 1, 0.5);  
  6.     border-radius: 15px;  
  7.     -moz-border-radius: 15px;  
  8.     -webkit-border-radius: 15px;  
  9.     text-decoration: none;  
  10.     padding: 5px 15px;  
  11.     background-image: -webkit-gradient(linear,left top,left bottom, color-stop(0, #ffffff),color-stop(1, #dbdbdb));  
  12.     text-shadow: #fef 0 1px 0;  
  13.     float: left;  
  14.     margin-bottom: 15px;  
  15.     margin-right: 15px;  
  16.     color: #497390;  
  17.     display: block;  
  18.     line-height: 24px;  
  19.     font-weight: bold;  
  20.     font-size: 20px;  
Now it's time to give some "hover" and "active" effect for our button
  1. a.button2:hover {  
  2.     color: #111;  
  3.     display: block;  
  4.     background-image: -webkit-gradient(linear,left top,left bottom, color-stop(0, #ffffff),color-stop(1, #eeeeee));  
  5. }  
  6.   
  7. a.button2:active {  
  8.     text-shadow: 0px -1px 0 rgba(255, 255, 255, 0.5);  
  9.     margin-top: 1px;  
  10.     background-image: -webkit-gradient(linear,left top,left bottom, color-stop(0, #dbdbdb),color-stop(1, #ffffff));  
Now, we need an icon corresponding to our button's requirements, like here we have a call button, so now we use a call icon and use that image in our CSS:
  1. a.button2 {  
  2.     border: 1px solid #979797;  
  3. }  
  4.   
  5. a.button2.iconImg {  
  6.     padding-left: 11px;  
  7. }  
  8.   
  9. a.button2.iconImg span {  
  10.     padding-left: 36px;  
  11.     background: url(icon1.png) no-repeat 0 5px;  
  12. }  
  13.   
  14. a.button2.iconImg.call span {  
  15.     background-position: 0px -3px;  
Now our Call Button is ready to use.
 
Output
 
2.PNG
 
 

3. Tabulate Button

 
First, we need our HTML Code:
  1. <div>  
  2.      <a href="#" class="button1">Click Me !!</a>  
  3. </div> 
CSS Code
 
.button1 {
 
1. Put some Shadow
  1. -moz-box-shadow: inset 0px 0px 50px -14px #fff6af;  
  2. -webkit-box-shadow: inset 0px 0px 50px -14px #fff6af;  
  3. box-shadow: inset 0px 0px 50px -14px #fff6af; 
2. Now give some background effect
  1. background: -webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ffe066), color-stop(1, #ffab23) );  
  2. background: -moz-linear-gradient( center top, #ffe066 5%, #ffab23 100% );  
  3. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe066', endColorstr='#ffab23');  
  4. background-color: #ffe066; 
3. Provide some border radius for all sides:
  1. -webkit-border-top-left-radius: 15px;  
  2. -moz-border-radius-topleft: 15px;  
  3. border-top-left-radius: 15px;  
  4.   
  5. -webkit-border-top-right-radius: 15px;  
  6. -moz-border-radius-topright: 15px;  
  7. border-top-right-radius: 15px;  
  8.   
  9. -webkit-border-bottom-right-radius: 0px;  
  10. -moz-border-radius-bottomright: 0px;  
  11. border-bottom-right-radius: 0px;  
  12.   
  13. -webkit-border-bottom-left-radius: 0px;  
  14. -moz-border-radius-bottomleft: 0px;  
  15. border-bottom-left-radius: 0px; 
4. Some simple CSS code:
  1.     text-indent: 2.58px;  
  2.     border: 5px solid #b50909;  
  3.     display: inline-block;  
  4.     color: #333333;  
  5.     font-family: Comic Sans MS;  
  6.     font-size: 17px;  
  7.     font-weight: bold;  
  8.     font-style: normal;  
  9.     height: 53px;  
  10.     line-height: 53px;  
  11.     width: 106px;  
  12.     text-decoration: none;  
  13.     text-align: center;  
  14.     text-shadow: 1px 2px 1px #ffee66;  
5. Now give some hover effect for our button:
  1. .button1:hover {  
  2.     background: -webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ffab23), color-stop(1, #ffe066) );  
  3.     background: -moz-linear-gradient( center top, #ffab23 5%, #ffe066 100% );  
  4.     filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffab23', endColorstr='#ffe066');  
  5.     background-color: #ffab23;  
6. Finally, give some effect when the button is active:
  1. .button1:active {  
  2.         position: relative;  
  3.         top: 1px;  
Output
 
3.PNG
 

4. Stylish Blue

 
HTML Code:
  1. <div>  
  2.     <a href="#" class="css_btn_class">Submit</a>  
  3. </div> 
CSS Code
 
In this button we used simple CSS with some "gradient" effect, therefore, our button is looking more beautiful than before
 
1. Provide some simple CSS
  1. .css_btn_class {  
  2.     font-size: 22px;  
  3.     font-family: Arial Black;  
  4.     font-weight: normal;  
  5.     -moz-border-radius: 42px;  
  6.     -webkit-border-radius: 42px;  
  7.     border-radius: 42px;  
  8.     border: 5px solid #82b9f0;  
  9.     padding: 8px 19px;  
  10.     text-decoration: none;  
  11.     background: -webkit-gradient( linear, left top, left bottom, color-stop(5%, #8abbeb), color-stop(100%, #2f88e0) );  
  12.     background: -moz-linear-gradient( center top, #8abbeb 5%, #2f88e0 100% );  
  13.     background: -ms-linear-gradient( top, #8abbeb 5%, #2f88e0 100% );  
  14.     filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#8abbeb', endColorstr='#2f88e0');  
  15.     background-color: #8abbeb;  
  16.     color: #ffffff;  
  17.     display: inline-block;  
  18.     text-shadow: 0px -3px 0px #5691cc;  
  19.     -webkit-box-shadow: -1px -6px 20px 9px #c5e0fa;  
  20.     -moz-box-shadow: -1px -6px 20px 9px #c5e0fa;  
  21.     box-shadow: -1px -6px 20px 9px #c5e0fa;  
2. Now give some hover effect:
  1. .css_btn_class:hover {  
  2.     background: -webkit-gradient( linear, left top, left bottom, color-stop(5%, #2f88e0), color-stop(100%, #8abbeb) );  
  3.     background: -moz-linear-gradient( center top, #2f88e0 5%, #8abbeb 100% );  
  4.     background: -ms-linear-gradient( top, #2f88e0 5%, #8abbeb 100% );  
  5.     filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#2f88e0', endColorstr='#8abbeb');  
  6.     background-color: #2f88e0;  
  7. }  
  8.   
  9. .css_btn_class:active {  
  10.     position: relative;  
  11.     top: 1px;  
Output
 
4.PNG