Click to See Complete Forum and Search --> : Validate
MacPC
06-05-2008, 10:04 AM
I am wondering what it really mean to have a site validated. In some ways, it helps to clean up some messy codes, but however, even Mozilla's own site, came up with tons of warnings and errors, what does this say?
It seems to me there is no way a site can pass ever validation, especially when it comes to some proprietary stuffs like opacities, and also the hacks to get stupid IEs to work.
As far as I know, isn't it more important to get the site to work as intended rather that passing all validation but not working properly?
I am curious what your opinions are regarding this issue.
NogDog
06-05-2008, 10:25 AM
When a web page works in spite of invalid mark-up, it only does so because the browsers you have tested it with have let you get away with it. Personally, I do not like having to depend on the client application correctly "guessing" what I intended, and prefer to get it completely right. Also, if it is 100% valid [X]HTML mark-up, then I know any search engine should have no problem parsing the document, whereas I cannot be 100% sure of that if it is invalid.
CSS validation is a bit more problematic, and while I always strive for 100% compliance, if forced to do something like using opacity settings I won't lose any sleep over it. While the visual presentation may suffer in certain situations, if the document is still valid [X]HTML then it will still parse correctly and be readable by all browsers. (However, in situation where I have sufficient control of the style choices, I avoid using all non-standard attributes, as they generally are nothing more than "eye candy" and seldom add anything to the site's quality other than making the designer happy.)
... and also the hacks to get stupid IEs to work...
You don't need hacks, use conditional comments (http://msdn.microsoft.com/en-us/library/ms537512.aspx).
Tezcatlipoca
06-06-2008, 10:45 AM
I have to agree with the OP to some degree. All my sites have a few validation errors when checking the HTML markup, and those sites all look and function fine, even through pretty rigorous tests on various browsers, browser versions, and through a range of resolutions.
Now you match that against something like, say, the BBC's News website; easily one of the most popular, and most accessed on a range of technologies, websites in the world. It has well over three hundred validation errors (http://validator.w3.org/check?uri=http%3A%2F%2Fnews.bbc.co.uk&charset=%28detect+automatically%29&doctype=Inline&group=0).
Of course, by contrast, every CSS stylesheet I write is checked and always comes back 100% valid.
NogDog
06-06-2008, 12:04 PM
The fact that sites get away with invalid mark-up does not make it OK, it just means they get away with it. It really is not all that hard to generate valid [X]HTML if you actually understand the protocol, especially with the availability of tools like HTML Tidy as well as the w3.org validators. Unfortunately, (a) modern browsers generally let you get away with sloppy mark-up (just try writing a program with syntax errors in Java, C++, PHP, etc.: you either get nothing, error messages, or invalid output), and (b) many, many so-called "web developers" and "web designers" out there have virtually no concept of what it takes to create truly valid [X]HTML, and probably cannot read/interpret the HTML specification.
Again, if you write 100% valid [X]HTML/CSS, you are never at the mercy of a browser "guessing" what you wanted, and if the browser then gets it wrong, it's its fault, not yours. Besides, with the proliferation of web-enabled devices and browsers out there, when your mark-up is valid you increase your confidence that all such devices can consume your pages, rather than either trying to test every such device or -- more likely -- just hoping they'll all work.