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

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

问题描述



 < meta 元元素属性name =content => 

 < meta property =content => 

元名和元属性有什么不同?

name 属性是在HTML中指定元数据的常用方法。它是在HTML5规范中定义的



属性属性来自 RDFa


RDFa 1.1扩展了HTML5,使可以在<$ c中使用 meta link 元素$ c> body ,只要它们包含属性属性。



您可以同时使用HTML5的名称和RDFa的属性一起放在同一个 meta 元素上。



请注意,您可能还会看到带有 itemprop的 meta 元素属性。这将来自 Microdata


Two common meta element attributes are:

<meta name="" content="">

and

<meta property="" content="">

what is the difference between meta name and meta property?

解决方案

The name attribute is the "usual" way for specifying metadata in HTML. It’s defined in the HTML5 spec.

The property attribute comes from RDFa.

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.

You can use both ways, HTML5’s name and RDFa’s property, together on the same meta element.

Note that you might also see meta elements with an itemprop attribute. That would be from Microdata.

这篇关于元名和元属性有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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