Is the copyright meta tag valid in HTML5?

2019-01-11 10:15发布

<meta name="copyright" content="By Me" />

W3C validator output:

Line 5, Column 41: Bad value copyright for attribute name on element meta: Keyword copyright is not registered.

I need to set the copyright. Any idea?

2条回答
我命由我不由天
2楼-- · 2019-01-11 10:51

Dublin Core has the rightsHolder term, which validates using the W3C HTML5 validator:

<meta name="dcterms.rightsHolder" content="Your Copyright-Holder Organization">

This is defined as A person or organization owning or managing rights over the resource.

Additional terms:

For a statement about property rights, we can use the regular rights term:

<meta name="dcterms.rights" content="Statement of copyright">

To add the date of copyright:

<meta name="dcterms.dateCopyrighted" content="2012">

Source: http://wiki.whatwg.org/wiki/MetaExtensions

Nitpick

According to the MetaExtensions document, all these statements must be accompanied by a special <link> element:

<link rel="schema.dcterms" href="http://purl.org/dc/terms/">
<meta name="dcterms.rightsHolder" content="Your Copyright-Holder Organization">

However, the W3C validator does not enforce this.

查看更多
叼着烟拽天下
3楼-- · 2019-01-11 11:07

TL;DR Most of the non standard meta tags are not yet available for HTML5 validators. Until then you should include a small tag if you must have valid code.


Ok, I did a little bit more research into the subject. The issue is that the metatags on the WHATWG wiki are supposed to be used by validators, but in many cases because the tags update so frequently most validators ignore them until they become official parts of the spec.

So the only standard metatags right now are:

  • application-name
  • author
  • description
  • generator
  • keywords

Eventually once the spec gets updated again the rights-standard metatag will validate as well, but until then we need a workaround ... which is ...

....drumroll....

The <small> tag!

The small element represents side comments such as small print.

Small print typically features disclaimers, caveats, legal restrictions, or copyrights. Small print is also sometimes used for attribution, or for satisfying licensing requirements.

Source: http://dev.w3.org/html5/spec/text-level-semantics.html#the-small-element


Also, just a side note. Just because your code doesn't validate doesn't mean it isn't valid. The spec is constantly evolving, so you just need to bear with it until things become more concrete.

查看更多
登录 后发表回答