0

我已经使用不同的 CSS 方法阅读了这个问题的大量答案,但我只是找不到适用于我的网站的解决方案。

示例 URL 是http://www.clubszone.co.uk/clubs/43(页面是动态生成的)

我正在尝试调整 Twitter、Facebook 和一个社交分享按钮。CSS 已用于其他社交分享,但目前尚未使用。

.social-single {
margin: 17px 0 0 0;
}

#twitterbutton, #fb-like, #stumblebutton, #sharebutton, #linkedinshare {
float: left;
display: block;
}

#fb-like{
margin-top:0px;
margin-left:-50px;
}

#stumblebutton {
margin-left: 20px;
margin-top: 1px;
}

#linkedinshare {
margin-left: 20px;
margin-top: 1px;
}

#plusonebutton {
margin-left: 20px;
margin-top: 1px;
}

包含在内容框中的 Html。

<div class="topshadow">
        <h2 class="wraptitle clubicon">
        Tell your friends about us
        <div class="social-single">
<div class="fb-like" id= "fb-like"data-href="https://www.clubszone.co.uk/findclubs" data-width="50" data-layout="button" data-action="like" data-show-faces="true" data-share="true"></div><div id="fb-root"></div>
<div id="twitterbutton"><a href="https://twitter.com/share" class="twitter-share-button" data-text="Search and find clubs near you" data-via="Clubszone1" data-size="small" data-related="clubszone1" data-hashtags="kidsclubs">Tweet</a></div><script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
<div id="plusonebutton"><g:plusone size="medium" data-annotation="none"></g:plusone></div><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?onload=onLoadCallback';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
  })();
</script>
</div>


Any help would be appreciated. 
4

2 回答 2

1

首先,您的 html 代码中有一个错误 - 所有块内容都在 h2 标记内,修复此问题然后调整内容的水平填充,+1 按钮的浮动是可以的谷歌开发工具截图

于 2014-03-23T21:20:54.920 回答
0
<?php 
        $currentUrl = Mage::helper('core/url')->getCurrentUrl();
    ?>
    <ul class="add-to-links">
        <li>
            <div class="fb-share-button" data-href="<?php echo $currentUrl; ?>" data-layout="button_count" data-size="small" data-mobile-iframe="true"><a class="fb-xfbml-parse-ignore" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%<?php echo $currentUrl; ?>%2F&amp;src=sdkpreparse">Share</a></div>
            <div id="fb-root"></div>
            <script>(function(d, s, id) {
              var js, fjs = d.getElementsByTagName(s)[0];
              if (d.getElementById(id)) return;
              js = d.createElement(s); js.id = id;
              js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.7&appId=1141295062596906";
              fjs.parentNode.insertBefore(js, fjs);
            }(document, 'script', 'facebook-jssdk'));</script>
        </li>
        <li>
            <!-- Place this tag where you want the share button to render. -->
            <div class="g-plus" data-action="share" data-annotation="bubble"></div>

            <!-- Place this tag after the last share 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/platform.js';
                var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
              })();
            </script>
        </li>
        <li>
            <a href="https://twitter.com/share" class="twitter-share-button" data-hashtags="VoidCanvas">Tweet</a>
            <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
        </li>
        <li>
            <a data-pin-do="buttonBookmark" data-pin-save="true" href="https://www.pinterest.com/pin/create/button/"></a>
            <script async defer src="https://assets.pinterest.com/js/pinit.js"></script>
        </li>
    </ul>
于 2016-08-08T06:59:41.117 回答