Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Aug 2009
    Location
    Maryland
    Posts
    47
    Thanks
    21
    Thanked 0 Times in 0 Posts

    Horizontal Alignment Of Social Media Share Buttons

    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 -->
    Code:
    .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 -->
    Code:
    <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

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,749
    Thanks
    22
    Thanked 1,838 Times in 1,822 Posts
    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 -

    Code:
    #plusonebutton {
    width: 200px;
    float: left;
    margin-top:0px;
    margin-left:2px;
    margin-right: 13px;
    }
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • Users who have thanked Excavator for this post:

    WebLizzard (05-22-2012)

  • #3
    New Coder
    Join Date
    Aug 2009
    Location
    Maryland
    Posts
    47
    Thanks
    21
    Thanked 0 Times in 0 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •