Facebook Like Button (<fb: like>) Height is always 80px
Why is the height of my Facebook Like button (technically generated by an iframe) always set to 80 pixels? Example page here: http://www.davidkasper.net/test.html I use javascript sdk and worked on other pages, but for some reason the height will not dynamically change this! I can even do something like <fb:like style="height:40px"> and it will really set the visible height, but the iframe will still be 80px, whereas I can see how this changes in the demo to http: // developers.facebook.com/docs/reference/plugins/like
I finally found the answer for this !!
The problem was that the application did not have the correct base domain application specified by me in javascript FB.init.
window.fbAsyncInit = function() { FB.init({appId: '**131226520233112**', status: true, cookie: true, xfbml: true}); }; (function() { var e = document.createElement('script'); e.async = true; e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; document.getElementById('fb-root').appendChild(e); }()); See the difference between http://davidkasper.net/test.html vs http://davidkasper.net/test2.html
By the way, I would never have discovered this without the Linter URL from Facebook http://developers.facebook.com/tools/lint/ Clearing all the errors I found solved the problem
From the reference it says
The most important social plugin is the Like button, which allows users to send pages from your site back to their Facebook profile with one click. You can add a Like button to any page with an iframe tag:
<iframe src="http://www.facebook.com/widgets/like.php?href=http://example.com" scrolling="no" frameborder="0" style="border:none; width:450px; height:80px"></iframe> There are several options Like button, including include names and profile pictures of friends of the user who also liked the page. Here's a button for the Facebook developer site ...
For me, this means that you should just use an iframe and set the width / height properties in the style tag ...
<iframe src="http://www.facebook.com/widgets/like.php?href=http://example.com" scrolling="no" frameborder="0" style="border:none; width:300px; height:25px"></iframe> Go to http://developers.facebook.com/docs/reference/plugins/like
Uncheck the box next to "Show faces." This will reduce the height to 35 pixels.