在HTML头标记中使用profile属性

时间:2022-11-19 14:48:46

What is the use of profile attributes in the HTML <head> tag?

在HTML 标记中配置文件属性的使用是什么?

I happened to read about it in here : http://www.w3schools.com/tags/tag_head.asp.

我碰巧在这里读到:http://www.w3schools.com/tags/tag_head.asp。

I could not understand this(http://www.w3.org/2002/12/namespace) either, since it is too technical (for me).

我也不能理解这个(http://www.w3.org/2002/12/namespace),因为它太技术性了(对我来说)。

I have never used it. What is the purpose it serves?

我从未用过它。它的目的是什么?

3 个解决方案

#1


18  

The URI in the profile attribute points to a document containing information regarding metadata. Profiles defines properties that may be used by the HTML meta tag and the HTML link tag. There are no prescribed formats for profiles. The profile attribute is no longer supported in HTML 5.

profile属性中的URI指向包含有关元数据的信息的文档。概要文件定义了HTML元标签和HTML链接标签可以使用的属性。配置文件没有指定的格式。在HTML 5中不再支持profile属性。

#2


16  

HTML5 has dropped the profile attribute from the head element (details).
You could however, use a rel attribute to the links to achieve this.

HTML5已经从head元素(细节)中删除了profile属性。但是,您可以使用rel属性来实现这一点。

So, instead of

因此,而不是

    <HEAD profile="http://www.acme.com/profiles/core">

it is now

现在

    <link rel="profile" href="http://gmpg.org/xfn/11" />

From W3,

从W3,

The profile attribute of the HEAD specifies the location of a meta data profile. The value of the profile attribute is a URI. User agents may use this URI in two ways:

头部的配置文件属性指定元数据配置文件的位置。配置文件属性的值是一个URI。用户代理可以用两种方式使用这个URI:

  1. As a globally unique name. User agents may be able to recognize the name (without actually retrieving the profile) and perform some activity based on known conventions for that profile. For instance, search engines could provide an interface for searching through catalogs of HTML documents, where these documents all use the same profile for representing catalog entries.
  2. 作为一个全局唯一的名称。用户代理可以识别名称(不实际检索概要文件),并基于该概要文件的已知约定执行一些活动。例如,搜索引擎可以为搜索HTML文档的目录提供一个接口,这些文档都使用相同的概要文件来表示目录条目。
  3. As a link. User agents may dereference the URI and perform some activity based on the actual definitions within the profile (e.g., authorize the usage of the profile within the current HTML document). This specification does not define formats for profiles.
  4. 作为一个链接。用户代理可以取消对URI的引用,并基于概要文件中的实际定义执行一些活动(例如,授权在当前HTML文档中使用概要文件)。此规范不定义概要文件的格式。

Simply put, XMDP introduced a simple way to define URLs and meanings used in an element, to read and write by both humans and machines as a dictionary of meta information. It was an initial attempt to achieve relations between elements.

简单地说,XMDP引入了一种简单的方法来定义元素中使用的url和含义,将人和机器作为元信息的字典进行读写。这是初步尝试实现各要素之间的关系。

To read more on this, find the references listed at the end of the answer.

要了解更多信息,请找到答案末尾列出的参考文献。

IMO, things have really improved in the recent past to achieve semantic relations thanks to introduction and implementations of Rich Snippets, which allows multiple formats for implementing structured data.
More information is available at schema.org and FAQ.

在我看来,由于富代码片段的引入和实现(允许实现结构化数据的多种格式),在最近的一段时间里,实现语义关系的工作得到了很大的改善。更多信息可以在schema.org和FAQ上找到。

Here is the list of supported markup formats

下面是支持的标记格式列表

  1. Microdata
  2. 微数据
  3. Microformats
  4. 微格式
  5. RDFa
  6. RDFa

... More Details

…更多的细节

With recent updates, there is also linking of author, and content published (Google+ only), by adding this :

在最近的更新中,还有作者链接和发布的内容(谷歌+ only),添加如下内容:

<link href="https://plus.google.com/{+PageId}" rel="publisher" />

References / Further reading :

参考文献/进一步阅读:

  1. http://www.w3.org/TR/html401/struct/global.html#profiles
  2. http://www.w3.org/TR/html401/struct/global.html的资料
  3. http://gmpg.org/xmdp/
  4. http://gmpg.org/xmdp/
  5. http://microformats.org/wiki/html5-profile#Section_7.4.1_-_The_HEAD_element
  6. http://microformats.org/wiki/html5-profile Section_7.4.1_ -_The_HEAD_element
  7. http://microformats.org/wiki/profile-uris
  8. http://microformats.org/wiki/profile-uris
  9. http://support.google.com/webmasters/bin/answer.py?hl=en&answer=99170&topic=1088472&ctx=topic
  10. http://support.google.com/webmasters/bin/answer.py?hl=en&answer=99170&topic=1088472&ctx=topic

#3


9  

The actual HTML 4 specification as opposed to the background on name spaces in general explains it better. Check out: http://www.w3.org/TR/1999/REC-html401-19991224/struct/global.html#profiles

实际的HTML 4规范(与名称空间的背景相反)更好地解释了它。请查阅:http://www.w3.org/TR/1999/REC-html401-19991224/struct/global.html概要文件

One real life use is to make it clear that your meta-data is not just an arbitrary system by you, but adheres to a system some one came up with.

现实生活中的一个用途是明确你的元数据不仅仅是你自己的一个任意系统,而是依附于某人提出的系统。

So for example, you may want to use the Dublin Core specification for your meta data. On a web page you would state this in the HEAD element using the profile attribute and then your meta tags would use Dublin Core elements like so:

例如,您可能希望使用Dublin Core规范来实现元数据。在web页面上,你可以使用profile属性在HEAD元素中声明这一点,然后你的meta标签会使用Dublin Core元素,比如:

<head profile="http://dublincore.org/documents/2008/08/04/dc-html/">
<meta name="DC.date" content="2010-11-22">
<meta name="DC.format" content="text/html">
<meta name="DC.contributor" content="Dublin Core Metadata Initiative>
<meta name="DC.language" content="en">

#1


18  

The URI in the profile attribute points to a document containing information regarding metadata. Profiles defines properties that may be used by the HTML meta tag and the HTML link tag. There are no prescribed formats for profiles. The profile attribute is no longer supported in HTML 5.

profile属性中的URI指向包含有关元数据的信息的文档。概要文件定义了HTML元标签和HTML链接标签可以使用的属性。配置文件没有指定的格式。在HTML 5中不再支持profile属性。

#2


16  

HTML5 has dropped the profile attribute from the head element (details).
You could however, use a rel attribute to the links to achieve this.

HTML5已经从head元素(细节)中删除了profile属性。但是,您可以使用rel属性来实现这一点。

So, instead of

因此,而不是

    <HEAD profile="http://www.acme.com/profiles/core">

it is now

现在

    <link rel="profile" href="http://gmpg.org/xfn/11" />

From W3,

从W3,

The profile attribute of the HEAD specifies the location of a meta data profile. The value of the profile attribute is a URI. User agents may use this URI in two ways:

头部的配置文件属性指定元数据配置文件的位置。配置文件属性的值是一个URI。用户代理可以用两种方式使用这个URI:

  1. As a globally unique name. User agents may be able to recognize the name (without actually retrieving the profile) and perform some activity based on known conventions for that profile. For instance, search engines could provide an interface for searching through catalogs of HTML documents, where these documents all use the same profile for representing catalog entries.
  2. 作为一个全局唯一的名称。用户代理可以识别名称(不实际检索概要文件),并基于该概要文件的已知约定执行一些活动。例如,搜索引擎可以为搜索HTML文档的目录提供一个接口,这些文档都使用相同的概要文件来表示目录条目。
  3. As a link. User agents may dereference the URI and perform some activity based on the actual definitions within the profile (e.g., authorize the usage of the profile within the current HTML document). This specification does not define formats for profiles.
  4. 作为一个链接。用户代理可以取消对URI的引用,并基于概要文件中的实际定义执行一些活动(例如,授权在当前HTML文档中使用概要文件)。此规范不定义概要文件的格式。

Simply put, XMDP introduced a simple way to define URLs and meanings used in an element, to read and write by both humans and machines as a dictionary of meta information. It was an initial attempt to achieve relations between elements.

简单地说,XMDP引入了一种简单的方法来定义元素中使用的url和含义,将人和机器作为元信息的字典进行读写。这是初步尝试实现各要素之间的关系。

To read more on this, find the references listed at the end of the answer.

要了解更多信息,请找到答案末尾列出的参考文献。

IMO, things have really improved in the recent past to achieve semantic relations thanks to introduction and implementations of Rich Snippets, which allows multiple formats for implementing structured data.
More information is available at schema.org and FAQ.

在我看来,由于富代码片段的引入和实现(允许实现结构化数据的多种格式),在最近的一段时间里,实现语义关系的工作得到了很大的改善。更多信息可以在schema.org和FAQ上找到。

Here is the list of supported markup formats

下面是支持的标记格式列表

  1. Microdata
  2. 微数据
  3. Microformats
  4. 微格式
  5. RDFa
  6. RDFa

... More Details

…更多的细节

With recent updates, there is also linking of author, and content published (Google+ only), by adding this :

在最近的更新中,还有作者链接和发布的内容(谷歌+ only),添加如下内容:

<link href="https://plus.google.com/{+PageId}" rel="publisher" />

References / Further reading :

参考文献/进一步阅读:

  1. http://www.w3.org/TR/html401/struct/global.html#profiles
  2. http://www.w3.org/TR/html401/struct/global.html的资料
  3. http://gmpg.org/xmdp/
  4. http://gmpg.org/xmdp/
  5. http://microformats.org/wiki/html5-profile#Section_7.4.1_-_The_HEAD_element
  6. http://microformats.org/wiki/html5-profile Section_7.4.1_ -_The_HEAD_element
  7. http://microformats.org/wiki/profile-uris
  8. http://microformats.org/wiki/profile-uris
  9. http://support.google.com/webmasters/bin/answer.py?hl=en&answer=99170&topic=1088472&ctx=topic
  10. http://support.google.com/webmasters/bin/answer.py?hl=en&answer=99170&topic=1088472&ctx=topic

#3


9  

The actual HTML 4 specification as opposed to the background on name spaces in general explains it better. Check out: http://www.w3.org/TR/1999/REC-html401-19991224/struct/global.html#profiles

实际的HTML 4规范(与名称空间的背景相反)更好地解释了它。请查阅:http://www.w3.org/TR/1999/REC-html401-19991224/struct/global.html概要文件

One real life use is to make it clear that your meta-data is not just an arbitrary system by you, but adheres to a system some one came up with.

现实生活中的一个用途是明确你的元数据不仅仅是你自己的一个任意系统,而是依附于某人提出的系统。

So for example, you may want to use the Dublin Core specification for your meta data. On a web page you would state this in the HEAD element using the profile attribute and then your meta tags would use Dublin Core elements like so:

例如,您可能希望使用Dublin Core规范来实现元数据。在web页面上,你可以使用profile属性在HEAD元素中声明这一点,然后你的meta标签会使用Dublin Core元素,比如:

<head profile="http://dublincore.org/documents/2008/08/04/dc-html/">
<meta name="DC.date" content="2010-11-22">
<meta name="DC.format" content="text/html">
<meta name="DC.contributor" content="Dublin Core Metadata Initiative>
<meta name="DC.language" content="en">