将 CSS 添加到 Facebook Like Box
我正在尝试将 css 样式添加到 Facebook Like Box XFBML 文件,但它不采用常规方式的样式表 - 它自己的样式表位于您的样式表之后。所以我做了一些搜索,发现帖子说要像这样将 css="youstylesheetlink.css" 添加到 fb:like-box 中:
<fb:like-box href="https://www.facebook.com/example" width="496" height="120" show_faces="true" border_color="" stream="false" header="false" css="http://example.com/css/style.css?2"></fb:like-box>
但无论我尝试什么,它都不会采用样式表。有人可以指导我如何实现这一目标吗?
谢谢。
I'm trying to add css styling to Facebook Like Box XFBML file but it doesn't take the stylesheet the regular way – its own stylesheet comes after yours. So I did some search and found posts that said to add css="youstylesheetlink.css" to the fb:like-box like this:
<fb:like-box href="https://www.facebook.com/example" width="496" height="120" show_faces="true" border_color="" stream="false" header="false" css="http://example.com/css/style.css?2"></fb:like-box>
But no matter what I try it doesn't take the stylesheet. Can anybody guide me how I can achieve this?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Facebook 过去允许您将自定义 CSS 传递到他们的点赞框,这就是为什么您会看到这种情况发生的示例。但他们暂时不允许你这样做。
Facebook used to allow you to pass custom css to their like box, and that is why you see examples of it happening. But they stopped allowing you to do this for now.
如果您能做到,记录在此处。
恕我直言,你不能修改 Facebook 的企业品牌……他们希望互联网上的任何地方都有一致的用户体验,否则,人们就会不信任那些看起来像自制“类似”盒子的东西。
另请参阅此...
嵌入式 Facebook Like-Box不让我设计它的风格。为什么?
If you could do it, it would be documented here.
IMHO, you cannot tinker with Facebook's corporate branding... they want a consistent user experience everywhere on the Internet, otherwise, you'll have people not trusting things that look like homemade "like" boxes.
Also see this...
Embedded Facebook Like-Box won't let me style it. Why?
除非您的网站恰好与 Facebook
iframe
具有相同的匹配协议、域和端口,否则您无法对其进行修改,因为 同源政策。Unless your website happens to have the same matching protocol, domain and port as the Facebook
iframe
, you can not modify it because of Same Origin Policy.