Web Standards - Valid (X)HTML and CSS code

by Sasa Bogdanovic ~ January 16th, 2008.

When creating a new web page, the first thing to do is to define a doctype. What is a doctype? It is a declaration of layout mode that is activated within the browser when it renders the page. Therefore, having a valid HTML/XHTML and CSS code means that the way web page is written complies with layout mode declared in doctype. In other words, by declaring a doctype and writing compliant (X)HTML and CSS code means that you create a page that you say you do. If that is the case, all browsers will render the page in the same way.

On the other side, if web page does not validate against the declared doctype, the way it will be displayed in any browser can be unpredictable as it will then depend on error-handling mechanisms which vary a lot from browser to browser.

It is like having an ID card, but being someone else. Yes, it is that bad.
There are a number of online services and extensions for different web browser that perform validation. Once your web page is ready, before putting it online, it should be validated. Some of the most popular ones are:

It is very probable that validation will reveal errors and highlight potential layout problems the developer did not expect to find. Once it becomes a habit, producing valid code leads to a faster development and is a foundation for easy management and maintenance.

What’s in it for me?

If you are just surfing the internet, go ahead and use these tools. It is good to know where you are.

If you are a web developer and you want to know more about doctypes, you might get more details by following :

If you are a business owner thinking about hiring a web development company to make or redesign your website, do a research before you make an agreement. Visit the websites of your potential service providers. Normally you will find web design portfolios. Do your homework. Visit the websites they have created and make sure they are HTML/XHTML and CSS valid. Consider hiring only those that are compliant. Believe me, it will save you a lot of trouble (time + money) in future.

If you liked this article, please feel free to submit it to your favorite social media website.
  • del.icio.us
  • digg
  • Reddit
  • StumbleUpon

Filed under: web design, web standards.

Leave a Reply