更改喜欢按钮的宽度 [英] Change the width of a like button

查看:72
本文介绍了更改喜欢按钮的宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试更改网站上喜欢"按钮的宽度,但是由于某些原因,它无法正常工作.我已经尝试了HTML5,iFrame和XFBML版本,但是它们都呈现为相同的大小.关于我在做什么错的任何想法吗?代码在下面.

I'm trying to change the width of the Like button on my site, but for some reason it's not working. I've tried the HTML5, iFrame and XFBML versions, but they all get rendered to the same size. Any ideas on what I'm doing wrong? Code is below.

<!DOCTYPE HTML>
<html xmlns:fb="http://ogp.me/ns/fb#">
   <head>
   </head>
   <body>
   <div class="fb-like" data-href="http://www.facebook.com" data-send="false" data-layout="button_count" data-width="2000" data-show-faces="false"></div>
   <fb:like href="http://www.facebook.com" send="false" layout="button_count" width="3000" show_faces="false"></fb:like>
   <iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com&amp;send=false&amp;layout=button_count&amp;width=1600&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:1600px; height:100px;" allowTransparency="true"></iframe>
   <div id="fb-root"></div>
    <script>
      window.fbAsyncInit = function() {
        FB.init({
          appId      : 'MY_ID', // App ID
          status     : true, // check login status
          cookie     : true, // enable cookies to allow the server to access the session
          oauth      : true, // enable OAuth 2.0
          xfbml      : true  // parse XFBML
        });

        // Additional initialization code here
      };


(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/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
    </script>
   </body>
</html>

推荐答案

最小宽度为55px.

Minimum width size is 55px.

3000可能有点太多.尝试在 http://developers.facebook.com/docs/reference/plugins使用该工具/like/来制作逼真的尺寸的按钮.

3000 is probably a bit too much. Try using the tool at http://developers.facebook.com/docs/reference/plugins/like/ to make a realistic sized button.

这篇关于更改喜欢按钮的宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆