Html 元标记中的属性 property="og:title" 是什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6535405/
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
What is the attribute property="og:title" inside meta tag?
提问by luca
I have this extract of website source code:
我有这个网站源代码的摘录:
<meta content="This is a basic text" property="og:title" />
What does this property attributestand for, and what is its purpose?
这个属性属性代表什么,它的目的是什么?
采纳答案by Marek Musielak
og:title
is one of the open graph meta tags. og:...
properties define objects in a social graph. They are used for example by Facebook.
og:title
是开放图元标记之一。og:...
属性定义社交图中的对象。例如,它们被 Facebook 使用。
og:title
stands for the title of your object as it should appear within the graph (see here for more http://ogp.me/)
og:title
代表您的对象的标题,因为它应该出现在图表中(有关更多信息,请参见此处http://ogp.me/)
回答by Neddy
The property
in meta tags allows you to specify values to property fields which come from a property library. The property library (RDFa format) is specified in the head tag.
该property
元标记允许您指定的值到来自物业库属性字段。属性库(RDFa 格式)在 head 标记中指定。
For example, to use that code you would have to have something like this in your <head
tag. <head xmlns:og="http://example.org/">
and inside the http://example.org/
there would be a specification for title
(og:title).
例如,要使用该代码,您必须在<head
标签中包含类似内容。<head xmlns:og="http://example.org/">
并且在里面http://example.org/
会有title
(og:title)的规范。
The tag from your example was almost definitely from the Open Graph Protocol, the purpose is to specify structured information about your website for the use of Facebook (and possibly other search engines).
您示例中的标签几乎肯定来自Open Graph Protocol,其目的是指定有关您网站的结构化信息以供 Facebook(以及可能的其他搜索引擎)使用。
回答by ArunValaven
A degree of control is possible over how information travels from a third-party website to Facebookwhen a page is shared (or liked, etc.). In order to make this possible, information is sent via Open Graph meta tags in the <head>
part of the website's code.
当页面被共享(或喜欢等)时,可以对信息如何从第三方网站传输到 Facebook 进行一定程度的控制。为了使这成为可能,信息是通过<head>
网站代码部分中的Open Graph 元标记发送的。
回答by Shadow Wizard is Ear For You
Probably part of Open Graph Protocolfor Facebook.
可能是Facebook的开放图谱协议的一部分。
Edit: guess not only Facebook - that's only one example of using it.
编辑:猜测不仅是 Facebook - 这只是使用它的一个例子。