0

ソーシャル メディア ボタンをすべて 1 行 (Twitter、Facebook、Google+) に設定しました。

問題は、Google+ ボタンの間隔が正しくないことです。Twitter および Facebook ボタンよりも約 3 倍の間隔があります。

パディングを変更しようとしましたが、それは役に立ちませんでした。Google+ ボタンの幅が問題なのではないかと思ったのですが、幅を変更するコードが見当たりません。

HTML:

<div class="copy_right_social">
<div class="social">
<ul id="social">

<li><a href="https://twitter.com/share" class="twitter-share-button" data-url="https://www.whatever.com" data-via="jimsmith" data-lang="en" data-related="anywhereTheJavascriptAPI" data-count="vertical">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></li>

<li><iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.whatever.com&amp;send=false&amp;layout=box_count&amp;width=80&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:80px; height:90px;" allowTransparency="true"></iframe></li>

<!-- Place this tag where you want the +1 button to render. -->
<li><div class="g-plusone" data-size="tall"></div></li>

<!-- Place this tag after the last +1 button tag. -->
<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>

</ul>
</div><!-- SOCIAL -->
</div><!-- COPY_RIGHT_SOCIAL -->

CSS:

.copy_right_social {
float: left;
width: 410px;
height: 100px;
margin: 15px 0 0 0;
padding: 0;
border: none;
background-color: #FFF;
}

.social {
list-style-type: none;
list-style-position: inside;
padding: 0;
}

.social li {
display: inline;
text-decoration: none;
padding: 15px 0 0 20px;
float: left;
}

JsFiddle のこの例。

4

1 に答える 1

2

3 つのボタンの幅が等しくありません。そのTwitterボタンは幅60px、Facebookは44px、gplusは50pxです。

したがって、それぞれに個別のクラスを定義し、幅を設定する必要があります。

.social li { float: left; }
.social li.twitter { width: 60px; }
.social li.facebook { width: 44px; }
.social li.gplus { width: 50px; }

これは、それらの間にスペースのない実用的なフィドルです(好きなだけ自由に追加してください):http://jsfiddle.net/7jC5f/

于 2012-09-02T21:47:17.407 に答える