2011-12-08 58 views
0

我想改變我的網站上的按鈕的寬度,但由於某種原因,它不工作。我已經嘗試過HTML5,iFrame和XFBML版本,但它們都被渲染爲相同的大小。關於我在做什麼的任何想法都是錯誤的?代碼如下。改變一個像按鈕的寬度

<!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> 

回答

0

我建議你請使用此插件HTML5

<div class="fb-like" data-href="your_link_goes_here" data-send="true" data-width="450" data-show-faces="true"></div> 

謝謝...

+0

的主要問題是,你設置節目面臨虛假和鍵是不是能增大 –