bprayudha
bprayudha

Reputation: 1034

What is the importance of being valid in HTML5?

My websites are fully functional, but when I check it in validator.nu or w3c validator, I always got the errors. Even youtube or google got so many errors. Check it here.

So what is the best solution for this? Fix the errors or keep going? Thanks!

Upvotes: 1

Views: 407

Answers (1)

Samuel Neff
Samuel Neff

Reputation: 74909

There are lots of reasons to validate your site.

Number one is validation is important because valid markup is far more likely to be treated consistently across browsers. The standards define what to do with valid markup. When faced with invalid markup, each browser may make its own decision on what to do. This can lead to inconsistencies.

Also some errors are more important than others. For example, YouTube has a lot of errors about <button href=""> since button doesn't have an href attribute. This isn't technically valid, but by tradition all browsers ignore extra attributes, so it's pretty safe.

Others are really more problematic. They have a <button> element contained inside an <a> element. Most browsers will handle this ok, but some will handle it by rewriting the DOM to close the original <a> element and then reopen a new one. If you're working with jQuery to manipulate the DOM, this would cause some failures.

Many more reasons at the url Incognito pointed out. http://validator.w3.org/docs/why.html#why_pros

Upvotes: 2

Related Questions