如何设置将在Facebook上显示为预览的网站图像? [英] How can I set a website image that will show as preview on Facebook?

查看:196
本文介绍了如何设置将在Facebook上显示为预览的网站图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当您在Facebook上分享一个链接时,会自动在网站上查找图像,随机选择一个作为预览。如何影响预览图像?一个人在他的Facebook上分享网站链接?

解决方案

1。将Open Graph XML命名空间扩展名包含到HTML声明中

  < html xmlns =http://www.w3.org/1999/xhtml
xmlns:fb =http://ogp.me/ns/fb#>

2。在< head>< / head> 中使用以下元标记定义要使用的图像



< pre class =lang-html prettyprint-override> < meta property =og:imagecontent =fully_qualified_image_url_here/>

详细了解开放图协议



执行上述操作后,使用<如果图像没有正确显示,则href =https://developers.facebook.com/tools/debug/og/object/rel =noreferrer> Facebook对象调试器。另请注意,除了高度和宽度也指定之外,第一次分享它仍然不会显示,请参阅在Facebook上分享 - 缩略图不显示第一次


When you share a link on facebook it will automatically find images on the website and randomly picks one as a preview. How can you influence the preview image? When a person shares the website link on his facebook?

解决方案

1. Include the Open Graph XML namespace extension to your HTML declaration

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:fb="http://ogp.me/ns/fb#">

2. Inside your <head></head> use the following meta tag to define the image you want to use

<meta property="og:image" content="fully_qualified_image_url_here" />

Read more about open graph protocol here.

After doing the above, use the Facebook "Object Debugger" if the image does not show up correctly. Also note the first time shared it still won't show up unless height and width are also specified, see Share on Facebook - Thumbnail not showing for the first time

这篇关于如何设置将在Facebook上显示为预览的网站图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆