Html fb:like-box,自定义 css?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4874755/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 06:28:46  来源:igfitidea点击:

fb:like-box, custom css?

htmlfacebookapifacebook-likebox

提问by Johan

Is it possible to add a custom css file to a fb:like-box? For example, I would like to remove the borders around the iframe. Thanks

是否可以将自定义 css 文件添加到 fb:like-box?例如,我想删除 iframe 周围的边框。谢谢

回答by DanielBlazquez

The new like-box does not accept the "css" attribute. You have to use the old fb:fan plugin to achieve it.

新的like-box 不接受“css”属性。你必须使用旧的 fb:fan 插件来实现它。

For example:

例如:

<fb:fan profile_id='[PAGE_ID]' width='300' height='256' show_faces='true' stream='false' header='false' css='[CSS_URL]'></fb:fan>

Remember to add the "all.js".

记得添加“all.js”。

回答by user1654320

<div id="fb-root"></div>

<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script>

<script type="text/javascript">FB.init("Your-App-ID");</script>

<fb:fan profile_id="Your-Page-Profile-ID" connections="20" width="300" height="300" css="http://example.com/likebox-style.css?1"></fb:fan>

Don't use live stream for pages with low post rate, the stream will be empty if there are only posts older than 6 weeks.

不要对发布率低的页面使用实时流,如果只有超过 6 周的帖子,流将是空的。

回答by Sara Farooqui

Facebook like box no longer supports css. Facebook reports: Support for custom CSS has been removed due to security implications. We now allow the likebox plugin to be rendered without a bordervia the show_border=falseargument. However, if you like to make your like box colorful you can use the svg gradient trick. Read - Styling Facebook Like Box With SVG

Facebook like box 不再支持 css。Facebook 报告:由于安全隐患,已删除对自定义 CSS 的支持。我们现在允许通过show_border=false参数在没有边框的情况下渲染 likebox 插件。然而,如果你想让你喜欢的盒子变得多彩,你可以使用 svg 渐变技巧。阅读 -使用 SVG 设计 Facebook Like Box

回答by Chris

You can add a cssattribute to the <fb:like-box>tag with a href to your custom CSS stylesheet. This will allow you to manipulate the existing styles.

您可以css<fb:like-box>带有 href的标签添加属性到您的自定义 CSS 样式表。这将允许您操作现有样式。

A good article on this subject: http://line25.com/tutorials/how-to-add-a-custom-facebook-like-box-to-your-site

关于这个主题的好文章:http: //line25.com/tutorials/how-to-add-a-custom-facebook-like-box-to-your-site

回答by LionsAd

More information about the topic:

有关该主题的更多信息:

If you want to use the force_wall attribute, you'll need to use the iframe version.

如果要使用 force_wall 属性,则需要使用 iframe 版本。

Basically:

基本上:

Go to:

去:

DONE

完毕