Do we use doctype only to render webpages in standard mode with IE6 ? or does doctype do something more than that?
+2
A:
The doctype actually tells ALL browsers the type of content in the page. In many browsers, you'll notice very little difference, but in IE it has two different rendering modes, so you'll see a larger difference.
You should be using a doctype on all of your HTML documents. The idea is that it will be a much simpler doctype in the future - HTML 5 looks like this:
<!DOCTYPE html>
Whereas HTML 4 is like this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
And has Transitional or Strict options.
Sohnee
2009-11-02 11:16:15
so if we do not use doctype then we won't get much differences in FF, opera , safari
metal-gear-solid
2009-11-02 11:17:54
IE has four modes unfortunately (IE8 anyway). Here's a fun flowchart: http://hsivonen.iki.fi/doctype/ie8-mode.png
Steerpike
2009-11-02 11:19:06
Other browsers also behave very differently depending on the doctype. See http://en.wikipedia.org/wiki/Quirks_mode
Joey
2009-11-02 11:23:33
A:
Doctype could also used to check that your page respects the W3C standard.
Lastnico
2009-11-03 13:19:10