Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was in a heated discussion the other day, about whether or not it's practical to have a perfect validation score on any HTML document. By practical I mean:

  • Does not take a ridiculous amount of time compared to it's almost-perfect counterpart.
  • Can be made to look good on older browsers and to be usable on very old browsers.
  • Justifies the effort it may take to do so (does it come with some kind of reward on SEO/Usability/Accessibility that cannot be achieved in a simpler way with almost-perfect validation)

So basically, is perfect validation score practical on any HTML document?

share|improve this question
@ElYusubov Your edit was too minor, it doesn't clarify anything. Rollback. Just because you have the edit privilege, doesn't mean you need to do it everywhere. – Madara Uchiha Jul 7 '12 at 14:52
It make sense to highlight your question and indicate what specific question you are stating. That and nothing extra was done by my edit. – Yusubov Jul 7 '12 at 14:58
@ElYusubov: you're abusing your edit privilege for a long time already. Maybe you should find another way to increase your reputation, instead of making minor and often worthless edits. – MainMa Jul 7 '12 at 15:07
@MainMa Although I agree with you and Truth that the edit was unnecessary, there's no reputation gain involved, ElYusubov has passed the 2K rep threshold and doesn't get the 2 points award for edits anymore. – Yannis Jul 7 '12 at 15:12
@ElYusubov I've declined a few of your suggested edits in the past, for being too minor. I've also noticed that other users have accepted similar edits of yours, thus implying that they were fine, when they were not. If there's someone to blame here, is high rep users blindly accepting minor edits instead of guiding low rep users to improve themselves. Read the edit privilege page to find out what edits we welcome, and if you want further feedback, feel free to ask about it on Meta. – Yannis Jul 7 '12 at 15:18
up vote 8 down vote accepted

Unless you're going to validate as HTML 3.2 or something (and lose all the perks that come with HTML 4 or 5), your HTML is going to break in very old browsers anyway. You're not really helping them just by having valid HTML 5. You'd have to wrap your CSS and JS in comments, provide fallback mechanisms for browsers that lack Ajax support, etc. So in reality, you are making more work for yourself if you care too much about that stuff.

So the question becomes, "how far back should i care about support?". And the answer depends on your target audience (keeping in mind that 100% compatibility with every browser is a pipe dream outside of intranets). If your site is expecting visits from PC users, there's no real need to support IE 3 or Mosaic or whatever -- no portion of users worth mentioning will be using it. Mobile browsers, maybe you want HTML 3.2 support (some phone browsers are hopelessly out of date). Past that, though, you don't really get anything but warm fuzzies.

What matters more is forward compatibility -- ensuring that as HTML evolves, upgrading browsers won't break your site. For that, validation is a better thing. The chance of support for stuff being removed is pretty low; even the HTML4 stuff that's "unsupported" in HTML 5 is supported, there are explicit instructions on how to treat it, and there's no real mechanism anymore to remove it (since doing so would break existing content). So if your page is valid HTML 4, and doesn't use (or provides fallback mechanisms for) the stuff that's new in HTML 5, that covers probably 99% of all users, even using most of the "old" browsers.

share|improve this answer
tl;dr (j.k.) So would you invest your time making sure your document is 100% valid? – Madara Uchiha Jul 7 '12 at 15:52
I would, but not because i care about old browsers. Because i care about new ones. Some times it's less practical than others, but there's always some value to it. – cHao Jul 7 '12 at 15:53

Since you didn't specify what kind of test are you talking about, i'm discussing this in general terms.

Many of this so called "validation test" are just a syntax check with a DOM of reference, this means that an high score is for a well formatted source, a lower score is for documents that does not respect the DOM guideline.

The main problem with the HTML is the fact that is an interpreted language and you do not have an implementation of reference and also the values and the attributes that you can use within the language can't be associated with an unique behaviour or an unique result.

Most of the times you also end up with the need for some hacks that can break your syntax check, sometimes is better having an uncorrected syntax rather than having an HTML page that looks ugly and can be rendered in the wrong way.

From what i know i also can't define Usability/Accessibility because this 2 words can have an infinite numbers of definitions, for a mobile user this can mean a website with bigger buttons, for a person with some eye problems can be interpreted as a better color contrast in the page; this really depends on what are you targeting.

As I said, this tests are just a syntax check but their real meaning is around zero or less, some clients can require thos little logos at the bottom of the page but i do not think that they know what a webpage is made of and how it works.

share|improve this answer

I know that the answer has been accepted already, but I just want to say this.

Different browsers respond differently to errors. If you have errors in your HTML, the probability that it will look the same in different browsers will be smaller.

This isn't about older browsers. It's about current browsers. If you look at your webpage with the latest browsers, differences in how they display it will be smaller if you use error-free HTML.

Here's a list with samples of how browsers respond to errors on my own website.

share|improve this answer

The question has no constructive answer unless it is clarified, but assuming that “validation” means what it used to mean (checking conformance to a Document Type Definition) in the HTML context, then the correct answer is: Validation as such means nothing except checking that your document complies to the formalized syntax rules that you wish to set up (by reference, which is the common way, or by giving your own rules). This is useful but relatively trivial.

If “validation” means using whatever program you’re using that claims to check for “validity”, then it all depends on what that program does.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.