How to tag a photo to be used as a thumbnail when a page is linked to on Facebook

╄→尐↘猪︶ㄣ 提交于 2019-12-03 08:00:48

问题


When a person posts a link on Facebook, Facebook automatically finds a photo to be used as a thumbnail that shows up in the news feed. Is there some sort of (HTML) markup to surround a photo you'd like to use as the first choice?


回答1:


What you want are the <meta> tags that Facebook defines in their documentation on Facebook_Share/Specifying_Meta_Tags.

You don't put the metadata around the image itself, rather, you put it in the head of the document, like this:

<meta name="title" content="The Title Of The Link" />
<meta name="description" content="A description of the link would go here." /> 
<link rel="image_src" href="http://www.example.com/images/image.jpg" />



回答2:


The accepted answer is now out of date. The new way to do it is with an open graph tag e.g.

<meta property="og:image" content="http://example.com/picture.jpg" />



回答3:


keep in mind that if everything doesn't work, than, may be, you should reload Facebook cache. http://developers.facebook.com/tools/lint/



来源:https://stackoverflow.com/questions/1810854/how-to-tag-a-photo-to-be-used-as-a-thumbnail-when-a-page-is-linked-to-on-faceboo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!