简体   繁体   中英

Facebook post url image

Just wondering what HTML5 element is shown as the image for a Facebook post which contains a preview of the URL mentioned in the post?

I want to post a link to my website and have my logo appear in the image box of the URL preview...

Hopefully my question makes sense.

You can achieve that by adding Facebook specific OpenGraph meta tags in the header of your webpage. Here are the meta tags you need to add

<meta property="og:url"                content="WEBSITE LINK" />
<meta property="og:type"               content="article" />
<meta property="og:title"              content="IT WILL APPEAR IN BIG FONTS" />
<meta property="og:description"        content="THIS WILL BE SUBTEXT" />
<meta property="og:image"              content="LINK OF THE IMAGE" />

you can check out meta tags in details here

Also to verify how it will look and what actually Facebook sees through meta tags you can go to the Open Graph Object Debugger

Example shows what will be seen once you try to share https://images.google.com

Hope this is what you are looking for.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM