Two common meta
element attributes are:
<meta name="" content="">
and
<meta property="" content="">
what is the difference between meta name and meta property?
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.
viewport
as value for the property
attribute would mean something totally different from using it as value for the name
property; it’s not that some browsers support it like that and some don’t (at least, it should not be), and browsers typically don’t use RDFa anyway (it’s for RDFa parsers, browser add-ons, etc.). –
Lassalle name|value
and name|content
tags – it only works specifically with property|content
. –
Sentimentalism meta
element: <meta name="description" property="og:description" content="">
–
Lassalle property
instead of name
? So we could use both attributes in the same meta
element? –
Scyphus name
, but other situations even rightout ignore name
, is there reliable documentation about when to use what attribute? –
Sentimentalism name="og:image"
, LinkedIn would just get some random image from the page, sometimes even selected an icon. Now that I use both (name="image" property="og:image"
) it gets the right image. –
Argali © 2022 - 2024 — McMap. All rights reserved.
property="og:dscription"
andname="description"
attributes as the same – Edora