Html 版权元标记在 HTML5 中有效吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6665312/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is the copyright meta tag valid in HTML5?
提问by Miki
<meta name="copyright" content="By Me" />
W3C validator output:
W3C 验证器输出:
Line 5, Column 41: Bad value copyright for attribute name on element meta: Keyword copyright is not registered.
第 5 行,第 41 列:元素元属性名称的版权价值错误:未注册关键字版权。
I need to set the copyright. Any idea?
我需要设置版权。任何的想法?
回答by Karl Horky
Dublin Core proposes the rightsHolder
term (an extension to the <meta>
name
attribute), which validates using the W3C HTML5 validator:
Dublin Core 提出了这个rightsHolder
术语(<meta>
name
属性的扩展),它使用 W3C HTML5 验证器进行验证:
<meta name="dcterms.rightsHolder" content="Your Copyright-Holder Organization">
This is defined as A person or organization owning or managing rights over the resource.
这被定义为 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:
对于关于产权的陈述,我们可以使用正则rights
术语:
<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
来源:http: //wiki.whatwg.org/wiki/MetaExtensions
Nitpick
挑剔
According to the MetaExtensions document, all these statements must be accompanied by a special <link>
element:
根据 MetaExtensions 文档,所有这些声明都必须伴随一个特殊<link>
元素:
<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.
但是,W3C 验证器不会强制执行此操作。
回答by Swift
TL;DRMost of the non standard meta tags are not yet available for HTML5 validators. Until then you should include a small tag if you musthave valid code.
TL;DR大多数非标准元标记尚不可用于 HTML5 验证器。在此之前,如果您必须拥有有效代码,您应该包含一个小标签。
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.
好的,我对该主题进行了更多研究。问题是 WHATWG wiki 上的元标签应该由验证器使用,但在许多情况下,因为标签更新如此频繁,大多数验证器会忽略它们,直到它们成为规范的正式部分。
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 ...
最终,一旦规范再次更新,rights-standard
元标记也会验证,但在那之前我们需要一个解决方法......这是......
....drumroll....
....鼓点....
The <small>
tag!
该<small>
标签!
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.
small 元素代表旁注,例如小字。
小字体通常包含免责声明、警告、法律限制或版权。小字体有时也用于归属或满足许可要求。
Source:http://dev.w3.org/html5/spec/text-level-semantics.html#the-small-element
来源: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.
另外,只是一个旁注。仅仅因为您的代码未通过验证并不意味着它无效。规范在不断发展,所以你只需要忍受它,直到事情变得更加具体。