W3C 验证重要吗? [英] Is W3C validation important?

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

问题描述

可能的重复:
W3C XHTML/CSS 验证在完成工作时有多重要?

我从许多来源阅读了有关验证的信息,大多数人会说始终验证您的网页.您的页面验证很重要.

I read about validation from many sources and most will say always validate your web page. It is important that your page validate.

我理解这个概念.但是我的网站不会验证",但它可以在所有主要浏览器中运行,不会在这些浏览器中产生错误并且在所有浏览器中看起来都是正确的.

I understand the concept. But my site does not "validate", yet it works across every major browsers, does not produce errors in those browsers and looks correct in all browsers.

这是我得到的一个错误示例

This is an example of an error I get

Error Line 38, Column 28: document type does not allow element "h3" here

var $jsuccessmessage = "<h3>We will be in contact soon. </h3>"; // success mess…

The element named above was found in a context where it is not allowed. This
could mean that you have incorrectly nested elements -- such as a "style"
element in the "body" section instead of inside "head" -- or two elements
that overlap (which is not allowed).

所以我问,我纠正这些错误并尽我所能生成经过充分验证的代码有多重要?

So I ask, how important is it that I correct these errors and do my best to produce fully validated code?

注意:我的文档类型使用 XHTML 1.0 Transitional.

Note: I am using XHTML 1.0 Transitional for my doctype.

推荐答案

正确的标记非常重要.仅仅因为某些无效标记在您关心的所有当前版本的浏览器中都有效,并不意味着它会在未来版本中继续有效.只要浏览器市场存在一些竞争,浏览器往往会更接近标准,而非标准 HTML 以有趣的方式失败的可能性更高.

Proper markup is pretty important. Just because some invalid markup works in all of the current versions of the browsers you care about doesn't mean that it will keep working in future versions. As long as there is some competition in the browser market, the browsers tend to get closer to the standard and non-standard HTML has a higher chance of failing in interesting ways.

坚持标准可以帮助您在未来证明自己的工作,并帮助您养成良好的习惯.

Sticking to the standards helps you future proof your work and it helps you build good habits.

考虑有多少大型组织仍然坚持使用 IE6(是的,6).他们为什么坚持下去?他们坚持使用它是因为他们构建了一套关键的应用程序,由于非标准的 HTML、CSS、JavaScript、ActiveX 等,这些应用程序只能在 IE6 上运行.无需支付完全重写费用即可更新.如果他们首先按照标准构建(通过黑客和杂乱来解释一直存在的非标准行为),那么一次向前推进一点点会更容易.

Consider how many large organizations are still stuck using IE6 (yes, 6). Why are they stuck with it? They are stuck with it because they had a suite of critical applications built that only work on IE6 due to non-standard HTML, CSS, JavaScript, ActiveX, etc. These poor people are stuck with a pile of creaky ancient applications that can't be updated without paying for a complete rewrite. If they built to standards in the first place (with hacks and kludges to account for the ever present non-standard behavior), it would be easier to move forward a little bit at a time.

你建造的所有非标准的东西都会让你停留在当下,让你在下个月陷入过去.冲浪时没有充分的理由穿混凝土靴子,更没有理由让您的客户穿它们.

Everything you build that is non-standard anchors you in the present and leaves you stuck in the past next month. There's no good reason to wear concrete boots when surfing and even less reason for your clients to wear them.

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

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