...

View Full Version : Horizontal Alignment Of Social Media Share Buttons



WebLizzard
05-22-2012, 12:38 AM
I am trying to horizontally align some social media share buttons at the bottom of a website. (Twitter Share, Facebook Count & Google +)
http://www.wisewebsitecreations.com

I enclosed the divs in a class (Social-Single), and I am able to get the Twitter and Facebook to line up next to one another, but my Google+ button keeps dropping to the next line.


My CSS -->
.social-single {
margin: 17px 0 0 0;
}

#twitterbutton, #likebutton, #stumblebutton, #sharebutton, #linkedinshare {
float: left;
display: block;
}

#likebutton {
margin-top:0px;
margin-left:2px;
margin-right: 13px;
}

#sharebutton {
margin-left:0px;
margin-top:0px;
margin-right: 5px;
}

#stumblebutton {
margin-left: 20px;
margin-top: 1px;
}

#linkedinshare {
margin-left: 20px;
margin-top: 1px;
}

#plusonebutton {
margin-left: 20px;
margin-top: 1px;
}


My HTML -->
<div class="social-single">

<div id="twitterbutton"><a href="https://twitter.com/share" class="twitter-share-button" >Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script></div>

<div id="likebutton"><div class="fb-like" data-send="false" data-layout="button_count" data-width="10" data-show-faces="false"></div></div>

<div id="plusonebutton"><!-- Place this tag where you want the +1 button to render -->
<g:plusone annotation="inline"></g:plusone>

<!-- Place this render call where appropriate -->
<script type="text/javascript">
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script></div>


</div>


Is there anything I am missing here? I'm really unsure why it isn't lining up. I am viewing in Internet Explorer.

Thanks in advance for any help!
~Liz

Excavator
05-22-2012, 05:01 AM
Hello WebLizzard,
The other buttons inherit a width somehow, I did not look further to see exactly where they get it from.

If you give #plusonebutton a width and float it, it works.
Something like this -



#plusonebutton {
width: 200px;
float: left;
margin-top:0px;
margin-left:2px;
margin-right: 13px;
}

WebLizzard
05-22-2012, 04:35 PM
Wow, thank you, thank you, thank you! It took me hours to try and figure this out yesterday. (As you can see, I clearly gave up on it and came here last night.) You were able to help me in minutes!!! This is why I love this forum.

Thank you again Excavator. I appreciate everything.

~Liz :thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum