元名称和元属性有什么区别? [英] What's the difference between meta name and meta property?

查看:63
本文介绍了元名称和元属性有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

两个常见的 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,因此 使用 metalinkbody 中的 code> 元素,只要它们包含 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆