私たちは、ajaxポートフォリオでレスポンシブデザインを使用するサイトでTwitter、Facebook、G+ボタンを手動でプログラムしました。それらはすべて互いに完全に整列していますが、問題は、周囲のコンテナのサイズに関係なく、3つすべてを中央に配置することです。
私の頭の中では、これはポートフォリオサイズに拡張するために100%の幅を持つ周囲のDivで簡単に機能するはずです。そのdivのボタンのコンテナ。ただし、何らかの理由で、常に左にハードアラインします。これが現時点での私のコードです。
これが例です
http://themixtapesite.com/#/joe-budden-a-lose-quarter
次に、ブラウザウィンドウを変更して小さくし、さまざまなサイズをすべて動的に表示できるようにします。これらのソーシャルボタンを、現在のように左側ではなく中央にフロートさせたいと思います。
<!-- Social sharing buttons -->
<div class="social-single">
<div class="social-centre">
<div class="twit-button"><a href="https://twitter.com/share" class="twitter-share-button" data-via="mixtapes_4_free" data-lang="msa" data-related="realdannys" data-hashtags="mixtape">Tweet</a></div>
<div class="fb-button"><iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink($post->ID)); ?>&title=<?php wp_title( '|', true, 'right' ); ?>&send=false&layout=button_count&width=71&show_faces=false&action=like&colorscheme=light&font&height=21&appId=118471234925480" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width: 71px; height: 21px;" allowTransparency="true"></iframe>
</div>
<div class="gplus-button"><g:plusone href="<?php echo urlencode(get_permalink($post->ID)); ?>" size="medium" annotation="bubble" width="50px"></g:plusone></div>
</div> </div>
そしてCSS
/* Social Buttons */
.social-single {
display: block;
margin-left: auto;
margin-right: auto;
margin-top: 10px;
margin-bottom: 10px;
width: 100% !important;
}
.social-centre
{
margin-left: auto;
margin-right: auto;
}
.twit-button {
float: left;
margin: 0;
margin-right: 5px;
width: 80px;
}
.fb-button {
float: left;
margin: 0;
width: 80px;
}
.gplus-button {
float: left;
margin: 0;
width: 50px;
}