我可以去 facebook 获取“赞框”的代码。非常便利。
问题是,这个盒子的显示很差。它不一致。 “流”中的第一篇文章以这种缩进显示:
流中的下一篇文章以不同的(蹩脚的)缩进显示。
这是在同一个 likebox 中,我只是向下滚动。
效果不限于“Facebook 平台”的流。我也在其他流的 Likebox 中看到过它。
我想设置框的样式,尝试使缩进保持一致,但它似乎呈现为 iframe,这(我认为)意味着我无法设置它的样式,因为 S.O.P.
我该如何解决这个问题?
是否有解决方法可以在最终不是 iframe 的 div 中显示 likebox?
编辑:错误记录:http://developers.facebook.com/bugs/237053466346453
编辑:我比较了fb:fan
控件和likebox 控件。使用 fb:fan
东西,可以提供自定义 CSS 来设置内容的样式。 ( There are some caveats 。)我设置了文本的宽度和边距,还删除了 actorName
,这对每个帖子都是一样的。这是结果:
左边是用这段代码生成的:
<fb:fan profile_id='19292868552' width='292'
connections='0' show_faces='false' stream='true' header='false'
css='http://example.org/fb/customfanbox.css?_=6392'></fb:fan>
右边是这样产生的:
<iframe src="//www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fplatform&width=292&colorscheme=light&show_faces=false&border_color&stream=true&header=false&height=525"
scrolling="no"
frameborder="0"
style="border:none; overflow:hidden; width:292px; height:525px;"
allowTransparency="true">
对于左侧,如果您不想要 fb:fan
元素,您可以使用指向 fan.php 的 iframe,如下所示:
<iframe src='http://www.facebook.com/plugins/fan.php?connections=0&css=http%3A%2F%2Fexample.org%2Ffb%2Ffb%2Fcustomfanbox.css%3F_%3D0292&id=19292868552&locale=en_US&sdk=joey&stream=true&width=292&height=560'
scrolling="no"
frameborder="0"
style="border-bottom:1px grey solid; overflow:hidden; width:292px; height:525px;"
allowTransparency="true">
最佳答案
您可以尝试使用提供加载外部 CSS 文件的旧风扇框插件。我不知道它是否仍然有效。如果是这样,它可能随时停止工作。
您当然不是唯一遇到此类问题的人。我建议您提交功能请求/对现有功能请求/投票。
关于css - 如何修复 facebook 类似框中的缩进?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7514693/