Paul Paul - 7 months ago 11
HTML Question

How do I get these buttons inline?

I'm struggeling a bit with the sharebuttons for social media (Twitter, Facebook, Google+) because the facebook button is a few pixels more down than the other two.
I have the feeling I tried everything in my knowledge, by adding or removing divs, margin, padding etc.

This is the HTML code:

<div class="sharebuttons">
<div class="sharebutton"><div class="fb-share-button " data-layout="button" data-mobile-iframe="false"></div></div>
<div class="sharebutton"><a href="https://twitter.com/share" class="twitter-share-button">Tweet</a></div>
<div class="sharebutton"><div class="g-plus" data-action="share" data-annotation="none"></div></div>
</div>


And the only CSS code from my part:

.sharebutton{
display:inline;
}


And the result is this:

enter image description here

Answer

You can add just float:left and some width looking for your site:

.sharebutton {
  display: inline-block;
  float: left;
  width:auto;
}