Html 什么是 <link rel="image_src">

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19274463/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 14:16:35  来源:igfitidea点击:

What is <link rel="image_src">

htmlxhtml

提问by Heroes84

Today I came across a <link rel="image_src">tag. I don't know about it, so I use google. Google tell me that this tag are similar to og:image. So I came to open graph main site to read about it http://ogp.me/, but i found nothing about link rel="image_src". So this tag is replacement to meta property="og:image"or is in special tag in another specification ? How use this tag or for what is used?

今天我遇到了一个<link rel="image_src">标签。我不知道,所以我用谷歌。谷歌告诉我这个标签类似于og:image. 所以我打开图主站点来阅读它http://ogp.me/,但我没有找到关于链接的任何内容rel="image_src"。所以这个标签是替代 metaproperty="og:image"还是在另一个规范中的特殊标签?如何使用此标签或用于什么?

采纳答案by Jukka K. Korpela

The relattribute specifies the type of the link, i.e. the kind of the relationship between the document and the linked resource. Usually just a few keywords, like stylesheetand icon, are used. Although many other keywords have been proposed and registered, most of them are write-only: they are meant to express something, but nobody cares (no software uses the information).

rel属性指定链接的类型,即文档和链接资源之间的关系类型。通常只使用几个关键字,例如stylesheeticon。尽管已经提出并注册了许多其他关键字,但大多数都是只写的:它们旨在表达某些东西,但没有人在意(没有软件使用该信息)。

The extension mechanisms of HTML5 include, in the description of link types, a somewhat obscure mechanism that allows, in theory, anyone register his favorite keyword in the existing rel values wikito make documents using it as relvalue “conforming”.

HTML5 的扩展机制包括,在链接类型的描述中,一种有点晦涩的机制,理论上允许任何人在现有的 rel values wiki 中注册他最喜欢的关键字,以制作使用它作为rel“符合”值的文档。

And image_srchas indeed been registered there, with the information that it is used to “specify a Webpage Icon for use by Facebook, Yahoo, Digg, etc.”, no specification has been identified but an articleabout it is linked to, and it is “probably redundant with rel=icon”.

并且image_src确实在那里注册过,信息是“指定一个网页图标供 Facebook、雅虎、Digg 等使用”,没有指定任何规格,但链接了一篇关于它的文章,它是“使用 rel=icon 可能是多余的”。

回答by Adler

You can use this tag to use an image as the thumb for link share.

您可以使用此标签将图像用作链接共享的缩略图。

回答by TychaBrahe

When someone posts a link to your site on social media, such as Facebook, the image that is displayed with your link is usually the first one in your code. This may not be the image that best fits defines your site, and it may not fit well in the small box that Facebook posts. The link rel="image_src" tag lets you control what image (or images, you can have more than one by stacking separate references) is displayed alongside your link.

当有人在社交媒体(例如 Facebook)上发布指向您网站的链接时,与您的链接一起显示的图像通常是您代码中的第一个图像。这可能不是最适合定义您网站的图像,并且它可能不适合 Facebook 发布的小盒子。链接 rel="image_src" 标签可让您控制在链接旁边显示的图像(或图像,您可以通过堆叠单独的引用来显示多个图像)。