元名称和元属性有什么区别? [英] What's the difference between meta name and meta property?
问题描述
两个常见的 meta
元素属性是:
Two common meta
element attributes are:
<meta name="" content="">
和
<meta property="" content="">
元名称和元属性有什么区别?
what is the difference between meta name and meta property?
推荐答案
name
属性是在 HTML 中指定元数据的常用"方式.它是 在 HTML5 规范中定义的.
The name
attribute is the "usual" way for specifying metadata in HTML. It’s defined in the HTML5 spec.
property
属性来自 RDFa.
RDFa 1.1 扩展了 HTML5,因此 使用 meta
和 link
中的 code> 元素,只要它们包含 body
property
属性即可.
RDFa 1.1 extends HTML5 so that it’s valid to use meta
and link
elements in the body
, as long as they contain a property
attribute.
两种方式都可以,HTML5的name
和RDFa的property
,一起使用在同一个 meta
元素上.
You can use both ways, HTML5’s name
and RDFa’s property
, together on the same meta
element.
请注意,您可能还会看到具有 itemprop
属性的 meta
元素.这将来自 Microdata.
Note that you might also see meta
elements with an itemprop
attribute. That would be from Microdata.
这篇关于元名称和元属性有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!