What is a DOCTYPE and what does it do?
When a browser scans your website, the first thing it looks for is its DOCTYPE. It helps render your website the proper way. Ever realized that a browser isn’t a real life guy that can guess in what language and type it is written? Well, a browser is just a tool for people to view your website and if it doesn’t know what and how it has to show a page, there can be some problems in layout. So when there’s a wrong, outdated or no DOCTYPE at all, your HTML, CSS or DOM codes are rendered as they where designed in the late 90’s.
http://www.divitodesign.com/2007/05/what%e2%80%99s-a-doctype-and-what-does-it-do/

