TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Should I validate my HTML?

7 点作者 cpolis将近 12 年前
I have been doing web development for a while now and up until a few years ago I would validate the HTML and CSS of the sites that I built. Is there any value in validating HTML?<p>As an aside, HN has quite a few validation errors: http:&#x2F;&#x2F;validator.w3.org&#x2F;check?uri=https%3A%2F%2Fnews.ycombinator.com&amp;charset=%28detect+automatically%29&amp;doctype=Inline&amp;group=0&amp;user-agent=W3C_Validator%2F1.3+http%3A%2F%2Fvalidator.w3.org%2Fservices

5 条评论

DanBC将近 12 年前
Yes!<p>Having HTML and CSS that doesn&#x27;t validate is fine if you understand why it isn&#x27;t validating and you understand the consequences.<p>In my opinion the robustness principle (be generous in what you accept) is harmful for the web; there&#x27;s a lot of broken markup lying around.
wikwocket将近 12 年前
Given the value attributed to shipping and <i>minimum</i> viable products, I find it appropriate that HN has validation errors.<p>Perhaps we should design an image badge that says &quot;This site has invalid HTML!&quot; to go along with Reid Hoffman&#x27;s motto, &quot;If you are not embarrassed by the first version of your product, you&#x27;ve launched too late.&quot;
munimkazia将近 12 年前
You should validate and understand the errors, if any. Not all of those errors may even need to be fixed though
bjourne将近 12 年前
I do it personally because I like having the validator saying &quot;0 validation errors!&quot; Fixing the errors in entertaining work. But honestly, for production sites, it doesn&#x27;t matter one bit if the site has validation errors or not.
celwell将近 12 年前
No. Why limit yourself and your product? Just make sure it runs in your target browsers.