Alex Rivera | Logout

How important is it to follow web standards?

Asked 2009-02-21T22:55:07.513
19

I recently found out that most of the major websites fail W3C's markup and CSS validation tests. Therefore, how important is it really to follow web standards?

Edit
Report

1 Answer

1

I find that HTML validation can be handy UP TO A POINT.

After that point (i.e. where validation takes over from common sense) it becomes a hindrance, I believe that validation is a very useful DEVELOPMENT tool but it is not necessary to comply 100%, For example the XHTML Strict specification deprecates the target="" selector, thus making it not validate, but it still works perfectly, to achieve the same action without using the above code requires javascript code to the effect:

jQuery(document).ready(function($) {
    $('a').each(function(){
        if (($(this).attr('rel')=='external') || 
            ($(this).attr('rel')=='nofollow')) 
        {
             $(this).attr('target','_blank');
        }
    });
});

Now to implement the above rather than the simple target="" defies logic and good programming, CSS on the other hand usually does have to validate but there are exceptions; browser hacks and vendor specific tags, which in the current browser climate are a necessary evil, it will make your code invalid, but it WILL work in most major browsers, so it's really up to you, you can go for 100% compliance and jump through hoops to have a nice little badge on your site that says "XHTML Valid" or "HTML5 Valid" or whatever, or you can have a neat, functional and clean coded site that just works.

P.S. Before I get flamed and called hypocritical yes I do have one on my personal blogging site but my code isn't valid at the moment anyway.

Further reading: http://net.tutsplus.com/articles/general/but-it-doesnt-validate/

answered 2011-01-24T20:48:28.743

Your Answer