Definition of Doctype: it specifies the version of the HTML used in the document
When a doctype is used in one of your WebPages, you are telling the web browser how your webpage should be displayed in what versions of (X) HTML. Here the browser gets a list of supported tags from the DOCTYPE and it doesn’t include either proprietary tags (the tags of HTML that works on in the internet explorer) or deprecated tags (attributes and elements which has been deprecated in the latest versions of XHTML 1.0 and XHTML) in the list.
But generally HTML editors allow you to write any non HTML or HTML tags you wish to write inside your documents, even if a strict DOCTYPE is specified. Even if it’s incorrect, HTML editors allow you to write and save anything that you want unlike many XHTML editors.
Web Browsers are fairly forgiving
You can write incorrect or invalid HTML codes and get away with it because most of the Web Browsers which are being used are astonishingly forgiving. Web Browsers do not require a well informed or valid HTML because Web Browsers will display anything given to them as long as it is defined as text or HTML.
Unlike xml applications, Web Browser attempts to find at what the Web Page writer is aiming at and it displays however what it can display.
Web Browser Quirks Mode
When most of the Web Browsers are in the quirk mode it will display the WebPages slight differently. If your WebPages doesn’t have a DOCTYPE or a DOCTYPE without DTD attached to it you might notice some of the quirks, they are:
Class names of CSS are case insensitive
Colours of HTML are parsed differently (# is not necessary, missing digits are filled in a different way).
If a unit is left off sizes are calculated in pixels (px).
In its place of Modern Browsers, pages try to view similar to that of Netscape 4.
From where did the scroll bar come from?
IE 6 has an amazing feature to it that it adds to the documents that have got HTML tags which are proprietary from within its page and deprecated. It adds a horizontal bar to it.
One of the possible way to avoid the horizontal scroll bar, is to get rid of the HTML tags which are proprietary and deprecated HTML tags with a DOCTYPE declaration from with in a page
Why Use a DOCTYPE Declarations
It’s a pretty good idea to get in the habit of using DOCTYPE declarations on your web pages. You won’t be amused in that way that, how they display.
Do validate your HTM (to validate CSS, HTML and other web files with these HTML validators, they are: CSS validators, HTML validators, RSS validators, an XHTML validators and a p3p validator. They are all easy to use, just put the URL of the HTML and just click on the validate button to get validated) once you are comfortable using them, by validating the HTML you will not end with the surprises like horizontal scroll bar in IE 6.