【发布时间】:2012-01-05 16:02:11
【问题描述】:
我想在顶部的 4 个按钮之间放置相等的空间,但我遇到了麻烦。起初,“social-buttons” id 位于向左浮动的 DIV 中,但这导致滑块被推到右侧。
所以我将所有内容都更改为,现在填充样式似乎没有任何效果。
然后我尝试添加“display: inline-block;”因为我是从另一个 StackOverflow 问题中读到的,但这并没有帮助。
这是当前代码(忽略 PHP):
<!-- Social Buttons -->
<span id="social-buttons">
<fb:like href="<?php echo $url; ?>" send="false" layout="box_count" width="60" show_faces="false" font="verdana" class="fb-like"></fb:like>
<a href="https://twitter.com/share" class="twitter-share-button" data-url="<?php echo $url; ?>" data-text="<?php echo $tweet_text; ?>" data-count="vertical" data-via="Button_Space">Tweet</a><script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>
<g:plusone size="tall" callback="callback" href="<?php echo $url; ?>" class="google-plus-one"></g:plusone>
<script src="http://www.stumbleupon.com/hostedbadge.php?s=5&r=<?php echo $url; ?>"></script>
</span>
<!-- End Social Buttons -->
#social-buttons { display: inline-block; padding: 0 0 0 100px; }
.fb-like { padding: 3px 0 0 0; border:none; overflow:hidden; width:60px; height:90px; }
.twitter-share-button { padding: 6px 0 0 0; }
.google-plus-one { display: inline-block; padding: 0 0 0 10px; }
有什么想法吗?理想情况下,我希望最好的建议不仅是均匀地间隔按钮,而且首先要使用正确的代码将按钮放在该标题栏上;)我确信我的代码可以进行很多改进。
【问题讨论】:
-
我从这个问题中得到了建议:stackoverflow.com/questions/3588808/… 并在这里实现了它:buttonspace.com/contact 他们现在看起来不错!感谢大家的帮助。
标签: css