开发者

Facebook like button in <ul>

Facebook button is driving me nuts. I am trying to put all social buttons in one ul with "display: inline;" on the li elements. Here's the code:开发者_Python百科

        <ul id="social" class="grid_3 alpha">
            <li><a href="http://twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></li>
            <li><div class="g-plusone" data-size="medium" data-count="false"></div></li>
            <li><iframe src="http://www.facebook.com/plugins/like.php?locale=en_US&href&amp;send=false&amp;layout=button_count&amp;width=100&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:21px;" allowTransparency="true"></iframe></li>

        </ul>

Here are the results: with Safari:

Facebook like button in <ul>

and with Firefox:

Facebook like button in <ul>

Now why aren't they showing on the same line in Safari?

Thanks for any help!


Set the width of the <ul> to accommodate all 3 <li> tags, and float:left the <li> tags.

The critical point here is to set the defined width in the <ul>


Try adding float:left on li elements. In addition, you should define/reset margin and padding for your ul element, because that's what is accounting for the differences between the browsers.

Why does Firefox use other padding than Safari, Chrome and IE8?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜