7 days of unlimited WordPress themes, plugins & graphics - for free!* Unlimited asset downloads! Start 7-Day Free Trial
  1. Web Design
  2. Site Elements

QuickTip: Pressable CSS3 Social Buttons

Read Time: 5 mins

Hi! I have a quicktip for ya. How about some really awesome press-able social media buttons using pure CSS3? Sounds cool right... well that's what's in store for you today. I'm going to to show you how to create some really cool buttons that you can place on any project, so let's get started!~

Step 1 Punching out some HTML Markup

The markup here is very simple, clean and only requires a few lines of code.

For our main class, we'll be using a .container which is only used if you want yours to look exactly the same as this tutorial. We use it to place the buttons in the center of our canvas.
Next we will use a span to wrap our button and use the class, .button to create some spacing using a margin in our CSS file.
Lastly we'll simply add a link, an icon and some text to put on the button.

That's all there is to the HTML markup for the CSS3 buttons and you should now have something like this...

Step 2 Creating some Awesome Styles!

The first thing we're going to add is a body with a nice blue gravel background which can be found in the source files. Then we'll put a color on our links and style the container to center our buttons on the canvas using margin: 0 auto.
None of these three styles are required when putting the buttons on your own project but you may wan to create a specific link style for them, and to do that you could target it using .button > a

Now let's create some spacing between the buttons like so...

"Style your buttons in a way that users will want to press them.."

Now that we have some nice spacing, we can start to style our buttons in a way that users will want to press them.

By creating a nice gradient and a box shadow, we can make the buttons pop a little making them more clickable. Then we add some padding to the top, bottom and sides making the buttons much easier to read.

Now let's go ahead and flatten the button a little bit to make it look halfway pressed in by using the :hover selector. We'll also use the :focus selector so that we can retain these styles instead of having to duplicate the code for that state.

The button on the right is what the hover state should look like.

After creating the hover effects, we're going to add a bit of inset to the buttons when a user clicks the mouse making it appear like the user pressed the button into the background. In this technique we need to use two shadows and to do that we simply place a comma between each one. Support for more than one shadow

At this point you should have something like the image below with the inset button or focus state (the example left button).

Lastly we put a right padding to create some space between the icons and the button text, then we needed to move the icon down to align it and to do that without disturbing other elements, the best solution is to put a position of relative to keep it contained within .button and then push it down from the top by 2 pixels. By using top instead of padding-top or margin-top, we only affect the image instead of the entire button.

Ok, that's it for the styling and you should end up with something like this...

If yours doesn't look exactly like the image above, please go back and check your work.

And That's All She Wrote...

Great job! You've created some really awesome CSS3 buttons that make users want to take action. Thank you for participating and I sincerely hope you learned something new and valuable in this lesson.
Stay tuned for more tutorials to come your way. Also you can check out some of my products on the Envato marketplaces just below the author profile.

Please leave any questions or comments below.

Did you find this post useful?
Want a weekly email summary?
Subscribe below and we’ll send you a weekly email summary of all new Web Design tutorials. Never miss out on learning about the next big thing.
Scroll to top
Looking for something to help kick start your next project?
Envato Market has a range of items for sale to help get you started.