不能操纵Facebook的按钮宽度 [英] Can't manipulate width of Facebook Like Button
问题描述
我有一个边栏200px宽,我喜欢的Facebook按钮我放在里面是运行在DIV的边界之外。是否有任何解决方法来获取Like框文本来识别200px标记,并在需要时回流到新行?
I have a sidebar 200px wide and the Facebook Like button I have placed inside it is running outside the boundaries of the DIV. Are there any workarounds to get the Like box text to recognise the 200px mark and reflow onto new lines when needed?
我使用此代码: http://jsfiddle.net/tKkpm/2/
<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/all.js#xfbml=1&appId=437745402932329";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-like" data-href="http://www.facebook.com/google" data-send="false"
width="200" data-show-faces="false"></div>
推荐答案
。
Facebook Like按钮文档说明最小宽度必须为225像素。
The Facebook Like Button documentation states that the minimum width has to be 225 pixels.
有时可能小于该值的原因是因为您可以使用 iframe 。
The reason it can sometimes be less than that, is because you can use an iframe. Although smaller widths aren't fully supported, it does seem to work!
<iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2Fgoogle&send=false&layout=standard&width=200&show_faces=false&font&colorscheme=light&action=like&height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:200px; height:35px;" allowTransparency="true"></iframe>
请注意,您必须在两个不同的位置设置宽度!
Please note that you will have to set the width in two different places!
这篇关于不能操纵Facebook的按钮宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!