Breaking News
Loading...
Wednesday 15 May 2013

Create Google Plus-Style Button using CSS3 in Blogger

Create Google Plus-Style Button using CSS3 in Blogger
With everybody talking concerning Google plus recent website start off, I patterned it had been the proper time to undertake and recreate most likely one in every of the foremost noticeable element on the new social network. making buttons with CSS is one in every of the foremost experimented-with net style techniques around. The trend in CSS button style looks to be eliminating the utilization of pictures, particularly background pictures, from buttons. This rising trend is principally owing to the recent breakthrough of CSS3. Buttons have currently evolved in web coming up with, not simply their look and effects however the means they're designed.

Read Also:

With my latest experimentation with CSS3 properties such gradients, box shadows, transitions etc… The result is this set of Google Style buttons created with CSS 3 (no images used at all).You can view a demo

Advantages of creating buttons with css

There are many advantages to using CSS only ( without the use of image ) buttons for the following reasons :
No images need to be downloaded thus faster page loading .

  • Buttons expand to fit any length of text and it’s easy to alter the size, colour and effects. 
  • By using CSS, it allows you to create button on the fly with just an anchor link. You only need to declare the appropriate class/id of the button in the stylesheet and assign it to the the anchor link. 

How to use

1. Open Blogger –> Template –> Edit HTML.
2. Press Ctrl+F and search for ]]></b:skin> tag & add below code above it.

/*------------------------------------*\ BOB Google Plus BUTTONS \*------------------------------------*/ button { text-decoration: none; text-shadow: 0 1px 0 #fff; font: bold 11px Helvetica, Arial, sans-serif; color: #444; line-height: 17px; height: 18px; display: inline-block; float: left; margin: 5px; padding: 5px 6px 4px 6px; background: #F3F3F3; border: solid 1px #D9D9D9; border-radius: 2px; -webkit-border-radius: 2px; -moz-border-radius: 2px; -webkit-transition: border-color .20s; -moz-transition: border-color .20s; -o-transition: border-color .20s; transition: border-color .20s; height: 29px !important; cursor: pointer; } button:hover { background: #F4F4F4; border-color: #C0C0C0; color: #333; } button:active { border-color: #4D90FE; color: #4D90FE; -moz-box-shadow:inset 0 0 10px #D4D4D4; -webkit-box-shadow:inset 0 0 10px #D4D4D4; box-shadow:inset 0 0 10px #D4D4D4; } button.bluebtn { border: 1px solid #3079ED !important; background: #4B8DF8; background: -webkit-linear-gradient(top, #4C8FFD, #4787ED); background: -moz-linear-gradient(top, #4C8FFD, #4787ED); background: -ms-linear-gradient(top, #4C8FFD, #4787ED); background: -o-linear-gradient(top, #4C8FFD, #4787ED); -webkit-transition: border .20s; -moz-transition: border .20s; -o-transition: border .20s; transition: border .20s; } button.bluebtn:hover { border: 1px solid #2F5BB7 !important; background: #3F83F1; background: -webkit-linear-gradient(top, #4D90FE, #357AE8); background: -moz-linear-gradient(top, #4D90FE, #357AE8); background: -ms-linear-gradient(top, #4D90FE, #357AE8); background: -o-linear-gradient(top, #4D90FE, #357AE8); } button.greenbtn { border: 1px solid #29691D !important; background: #3A8E00; background: -webkit-linear-gradient(top, #3C9300, #398A00); background: -moz-linear-gradient(top, #3C9300, #398A00); background: -ms-linear-gradient(top, #3C9300, #398A00); background: -o-linear-gradient(top, #3C9300, #398A00); -webkit-transition: border .20s; -moz-transition: border .20s; -o-transition: border .20s; transition: border .20s; } button.greenbtn:hover { border: 1px solid #2D6200 !important; background: #3F83F1; background: -webkit-linear-gradient(top, #3C9300, #368200); background: -moz-linear-gradient(top, #3C9300, #368200); background: -ms-linear-gradient(top, #3C9300, #368200); background: -o-linear-gradient(top, #3C9300, #368200); } button.redbtn { border: 1px solid #D14836 !important; background: #D64937; background: -webkit-linear-gradient(top, #DC4A38, #D14836); background: -moz-linear-gradient(top, #DC4A38, #D14836); background: -ms-linear-gradient(top, #DC4A38, #D14836); background: -o-linear-gradient(top, #DC4A38, #D14836); -webkit-transition: border .20s; -moz-transition: border .20s; -o-transition: border .20s; transition: border .20s; } button.redbtn:hover { border: 1px solid #B0281A !important; background: #D14130; background: -webkit-linear-gradient(top, #DC4A38, #C53727); background: -moz-linear-gradient(top, #DC4A38, #C53727); background: -ms-linear-gradient(top, #DC4A38, #C53727); background: -o-linear-gradient(top, #DC4A38, #C53727); } button.action:hover { -moz-box-shadow: 0 1px 0px #DDD; -webkit-box-shadow: 0 1px 0px #DDD; box-shadow:iset 0 1px 0px #DDD; } button.action:active { -moz-box-shadow: none !important; -webkit-box-shadow: none !important; box-shadow: none !important; border-color: #C6C6C6 !important; } button.bluebtn:active { border-color: #2F5BB7 !important; } button.greenbtn:active { border-color: #2D6200 !important; } button.redbtn:active { border-color: #B0281A !important; } /*------------------------------------*\ $BUTTON LABEL \*------------------------------------*/ button span.label { display: inline-block; float: left; line-height: 17px; height: 18px; padding: 0 1px; overflow: hidden; color: #444; -webkit-transition: color .20s; -moz-transition: color .20s; -o-transition: color .20s; transition: color .20s; } button span.label { line-height: 15px !important; } button:hover .label.bluebtn { color: #7090C8; } button:hover .label.greenbtn { color: #42B449; } button:hover .label.yellow { color: #F7CB38; } button.bluebtn .label { color: #FFF !important; text-shadow: 0 1px 0 #2F5BB7 !important; } button.greenbtn .label { color: #FFF !important; text-shadow: 0 1px 0 #2D6200 !important; } button.redbtn .label { color: #FFF !important; text-shadow: 0 1px 0 #B0281A !important; } button.action .label { padding: 0 17px !important; } button.action:active .label { color: #333 !important; } button.bluebtn:active .label, button.greenbtn:active .label, button.redbtn:active .label { color: #FFF !important; }

3. There are 4 types of buttons, you just have to add the appropriate class name to the tag <button>.See example below :

<div class="buttons">
<button class="action bluebtn"><span class="label">Save</span></button>
<button class="action redbtn"><span class="label">Upload</span></button>
<button class="action greenbtn"><span class="label">Comment</span></button>
<button class="action"><span class="label">Cancel</span></button>
</div>

The code above will result in the following buttons :

Create Google Plus-Style Button using CSS3 in Blogger

Use this Code where you want :)

0 comments:

Post a Comment

 
Toggle Footer