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

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

问题描述

当您在 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.在 HTML 声明中包含 Open Graph XML 命名空间扩展

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.在您的 </head> 中使用以下元标记来定义您要使用的图像

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.

完成上述操作后,使用Facebook对象调试器",如果图像没有正确显示.另请注意,除非还指定了高度和宽度,否则第一次共享它仍然不会显示,请参阅 在 Facebook 上共享 - 缩略图不显示第一次

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天全站免登陆