【问题标题】:Twitter and Facebook buttons alignmentTwitter 和 Facebook 按钮对齐
【发布时间】:2012-02-26 20:56:21
【问题描述】:

上下文

我想在我的新网站上显示 Twitter 和 Facebook 按钮。

但我遇到了对齐问题。

代码

:

<span id="social">
    <a href="https://twitter.com/share" class="twitter-share-button" data-via="guillaumgregoir">Tweet</a>
    <div class="fb-like" data-href="http://csstooltip.com" data-send="false" data-layout="button_count" data-width="450" data-show-faces="false"></div>
</span>

:

#social {
    display: inline-block;
    margin-left: 24px;
}

div.fb-like {
    display: inline-block !important;
    margin-left: 100px;
    margin-top: -20px;
}

【问题讨论】:

  • 这里的 CSS 和/或 JavaScript 肯定比这里要多。您提供的 CSS 无法完成图片中显示的内容。

标签: html css html css button alignment social-networking


【解决方案1】:

从您的 CSS 中删除顶部边距 - 但您可以使用如下浮动:

<div>
<div style='float:left;'>
--put a button here
</div>
<div style='float:left;'>
--put a button here
</div>
<div style='clear:both;'>
</div>
</div>

【讨论】:

    猜你喜欢
    • 2013-02-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-12
    • 2011-10-25
    • 2011-06-13
    相关资源
    最近更新 更多