HTML5元验证 [英] HTML5 meta Validation

查看:132
本文介绍了HTML5元验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

p>有问题的页面是 http://www.jmphoto.dk/otus/index.html (它是一个旧的HTML4页面,我尝试用作HTML 5的基础/重做)



我无法找到一个解决方案来获取以下元标记进行验证或找到将验证它们的替代品

 < meta http-equiv =cache-controlcontent =no-cache /> 
< meta http-equiv =Expirescontent =0/>
< meta name =distributioncontent =Global/>
< meta name =copyrightcontent =(c)2012 OTUS/>

我周末的大部分时间都在网上寻找解决方案,但没有运气,所以我真希望有人聪明可以帮助我。

解决方案

好的,让我们先轻松一下:

 < meta last-modified =Thu,14 Apr 2011 12:17:27 GMT/> 

上次修改不是,从来没有是 meta 元素的有效属性。

 < meta http-equiv =cache-controlcontent =no-cache /> 
< meta http-equiv =Expirescontent =0/>

将缓存指令放入元标记并不是一个好主意,因为虽然浏览器可能会读取它们,但是代理赢了T。因此,它们是无效的,你应该发送缓存指令作为真正的HTTP头。

content =Global/>
< meta name =copyrightcontent =(c)2012 OTUS/>

分配也不 copyright meta 元素的 name 属性的可识别值。有效名称在 https://w3c.github.io中描述。 /html/document-metadata.html#standard-metadata-names http:// wiki .whatwg.org / wiki / MetaExtensions



我建议 dcterms.audience 而不是发行 dcterms.rights dcterms.rightsHolder 而不是版权

Im trying to make my first HTML5 page but i simply cant get it to validate W3C keeps telling me that i have some errors i my meta tags.

the page in question is http://www.jmphoto.dk/otus/index.html (its an old HTML4 page that i try to use as base/redeo as HTML 5)

I cant find anny solution to get the following metatags to validate or find anny substitutes for them that will validate

<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<meta last-modified="Thu, 14 Apr 2011 12:17:27 GMT" />
<meta name="distribution" content="Global" />
<meta name="copyright" content="(c) 2012 OTUS" />

I have used most of the weekend trying to find a solution on the net but with no luck so I realy hope somebody smart can help me with this.

解决方案

OK, let's take the easy one first:

<meta last-modified="Thu, 14 Apr 2011 12:17:27 GMT" />

last-modified is not and has never been a valid attribute of the meta element. Not sure what is intended here.

<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="Expires" content="0" />

Putting caching instructions into meta tags is not a good idea, because although browsers may read them, proxies won't. For that reason, they are invalid and you should send caching instructions as real HTTP headers.

<meta name="distribution" content="Global" />
<meta name="copyright" content="(c) 2012 OTUS" />

Neither distribution nor copyright are recognized values for the name attribute of the meta element. Valid names are described at https://w3c.github.io/html/document-metadata.html#standard-metadata-names and http://wiki.whatwg.org/wiki/MetaExtensions.

I recommend dcterms.audience instead of distribution and dcterms.rights dcterms.rightsHolder instead of copyright.

这篇关于HTML5元验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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