How to Display Horizontally

Discussion in 'CSS' started by theblurr5495, Jul 24, 2011.

  1. #1
    I have the following in my post footer. How can I display the icons horizontally? I tried display:inline; but no luck.

    <div class="share"><h3>Share</h3>
    <ul>
    <div class="twitter">
    <li><p><a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-via="jakeocallaghan">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></p></li>
    </div>
    <div class="facebook">
    <li><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fjakeocallaghan.com&amp;send=false&amp;layout=box_count&amp;width=450&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=90" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:90px;" allowTransparency="true"></iframe></p></li></div>
    <li><!-- Place this tag where you want the +1 button to render -->
    <g:plusone size="tall" href="http://jakeocallaghan.com"></g:plusone></p></li>
    </ul>
    </div>
     
    theblurr5495, Jul 24, 2011 IP
  2. kushsolitary

    kushsolitary Active Member

    Messages:
    139
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    75
    #2
    First of all, a <div> directly inside a <ul> is not allowed. So new code:

    
    <div class="share"><h3>Share</h3>
    <ul>
    <li>
    <div class="twitter">
    <p><a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-via="jakeocallaghan">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></p>
    </div>
    </li>
    <li>
    <div class="facebook">
    <iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fjakeocallaghan.com&amp;send=false&amp;layout=box_count&amp;width=450&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=90" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:90px;" allowTransparency="true"></iframe></p>
    </div>
    </li>
    <li><!-- Place this tag where you want the +1 button to render -->
    <glusone size="tall" href="http://jakeocallaghan.com"></glusone></p>
    </li>
    </ul>
    </div>
    
    HTML:
    Here's the css to make them align horizontally :)

    
    div.share ul {
       overflow: hidden;
    }
    
    div.share ul li {
       float: left;
       margin: 10px 10px 0 0;
    }
    
    Code (markup):
    I hope it helps :)
     
    kushsolitary, Jul 24, 2011 IP
  3. theblurr5495

    theblurr5495 Active Member

    Messages:
    436
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #3
    Hey, tried the code, but it didn't align them horizontally. D:
    .
     
    theblurr5495, Jul 24, 2011 IP
  4. kushsolitary

    kushsolitary Active Member

    Messages:
    139
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    75
    #4
    kushsolitary, Jul 24, 2011 IP
  5. theblurr5495

    theblurr5495 Active Member

    Messages:
    436
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #5
    Yeah no idea why it doesn't work. I copied and pasted the html into a widget then pasted the CSS to my custom.css file.
     
    theblurr5495, Jul 24, 2011 IP
  6. kushsolitary

    kushsolitary Active Member

    Messages:
    139
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    75
    #6
    can you show me your website? I will check it out and will see what can be done..
     
    kushsolitary, Jul 24, 2011 IP
  7. theblurr5495

    theblurr5495 Active Member

    Messages:
    436
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #7
    Awesome, here's a post. I am displaying them at the bottom. I'm using wordpress and thesis.
     
    theblurr5495, Jul 24, 2011 IP
  8. kushsolitary

    kushsolitary Active Member

    Messages:
    139
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    75
    #8
    Actually, according to your code on that site, the css should be:

    
    
    div.footer_items div.textwidget div.buttbutt  ul {
       overflow: hidden;
    }
    
    div.footer_items div.textwidget div.buttbutt ul li {
       float: left;
       margin: 10px 10px 0 0;
    }
    
    
    Code (markup):
     
    kushsolitary, Jul 24, 2011 IP
  9. theblurr5495

    theblurr5495 Active Member

    Messages:
    436
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #9
    Sorry, that still doesn't work D:
     
    theblurr5495, Jul 24, 2011 IP
  10. ardianet

    ardianet Member

    Messages:
    494
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    33
    #10
    is the problem persist ??

    what about give the link in a "block" and display it "inline"

    <div id="container">
     <div class="social">
       the FB code here
     </div>
    <div class="social">   the TWITTER code here </div></div>

    #container{

    }

    .social {
     display:block-inline;
    }

    or 

    .social { display:block;
     float:left;}

    or perhaps just

    .social { display:block;}

    well, hope that could help you out..
     
    ardianet, Aug 2, 2011 IP