简体   繁体   English

设置链接我的网页时显示的图像

[英]Set image that shows up when my web page is linked

When you paste a link on something like Facebook or Discord, there's this image that shows below it.当您将链接粘贴到 Facebook 或 Discord 之类的内容时,会在其下方显示此图像。 For example, if I link something from the Google Play Store to discord, the image I set in the play console as "Feature Graphic" shows up.例如,如果我将 Google Play 商店中的某些内容链接到 discord,则会显示我在游戏控制台中设置为“Feature Graphic”的图像。 How can I set this image on any HTML page?如何在任何 HTML 页面上设置此图像?

I know I can set a favicon like this:我知道我可以设置这样的图标:

<link rel="icon" href="favicon.png">

Can I do something similar for what I described?我可以为我所描述的做一些类似的事情吗?

You'll want to set the link preview meta tags as follows:您需要按如下方式设置链接预览元标记:

<meta property="og:title" content="Example Page">
<meta property="og:image" content="https://example.com/images/image.jpg">
<meta property="og:description" content="This is just an example page.">
<meta property="og:url" content="https://example.com/page.html">
<meta name="twitter:card" content="summary_large_image">

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 本地链接时视频未显示在页面中,但当源为 URL 时显示 - Video is not showing in page when linked locally but shows up when the source is a URL 图片不会显示在我的网页中 - Image won't show up in my web page 我在网页上显示了用户的电子邮件,但是当我在移动设备上拉出该页面时,有时却不显示 - I show the user's email on my web page but when I pull this page on mobile, it sometimes shows sometimes not 单击我的HTML页面中的图像时的弹出窗口 - Pop-up window when clicking on an image in my HTML page 共享我的网站时,Facebook不拾取页面上的图像 - Facebook dont pick up the image on the page when sharing my website jQuery Lightbox在打开页面时显示 - jQuery Lightbox shows up when opening page 为什么我的表格单独显示良好,但是放入整个页面时却弄乱了? - Why my Form shows good alone, but mess-up when put into the whole page? 当我不断刷新我的angularJS页面时,有时会显示内容,有时却不显示 - When I keep refreshing my angularJS page, the content sometimes shows up, sometimes doesn't 设置border-style:none; 在我的锚标签上但是当我点击链接时边框出现 - 为什么? - Set border-style:none; on my anchor tags but border shows up when I click on a link - why? 我的 php 文件显示过滤后的响应,但 responseText 在运行 web 页面时显示所有数据库值 - My php file shows filtered response but responseText show all the database values when run through web page
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM