My good old reference, which I read quite a long time ago, is About.com.
Notice: All doctypes must appear at the VERY beginning of the page, even before the html tag.
HTML Doctypes
Doctype #1: Unnamed Doctype - HTML 3.2
This Doctype indicates that all content of the page is written in HTML 3.2. This is probably the oldest version you should use, with the reliability of being fairly safe to use. Nearly all browsers will support it, because it is quite old and is basic HTML. This can be used for such things as Mobile device websites, or websites for something such as a PSP (PlayStation Portable), or other basic websites. It doesn't support some of the newer features, however.
The Syntax:
CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
Doctype #2: Transitional - HTML 4.01
This doctype is very nearly the most used one. It allows you to use older deprecated tags, such as the i, b, u, s, or font tags that are no longer contained within the Strict standards. This indicates that your content is the most up-to-date HTML, but still need a little backwards compatibility. It's good for old pages that you have updated to the more recent HTML.
The Syntax:
CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
Doctype #3: Strict - HTML 4.01
This Doctype is much harder to implement than any of the other HTML doctypes, but it's the best of the best, and meets the most recent standards. It completely obliterates all those deprecated tags. Make sure your HTML is very carefully constructed and that it matches the standards before using this. Not all browsers know the alternatives to the tags that are missing if you use the deprecated tags, though.
The Syntax:
CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
Doctype #4: Frameset - HTML 4.01
If you are using frames (NOT IFRAMES!) you absolutely MUST use this doctype if you want your pages to be valid.
The Syntax:
CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
Doctype #5: Quirk Mode - HTML 4.01
This isn't really a doctype. This is just what your HTML is reverted to if you don't specify a doctype, you use the HTML Transitional Doctype, or you use a doctype without a URL DTD specified.
The Syntax (More of an Example this time):
CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
XHTML Doctypes
Notice: If you use XHTML, always remember to add the
CODE
<?xml version="1.0" encoding="UTF-8" ?>
BEFORE the doctype, or it won't be valid. Also note that if you use XHTML, it must be PERFECT for it to work. You must have successfully opened and closed every tag in the correct order, and all tags must be typed in lowercase. If you do not, the entire page just dies in a browser-dependent error. It opens up many more possibilities for programming pages, but lets in a little more room for errors. Use the same consideration for the XHTML doctypes as you did for the HTML doctypes.
Doctype #6: Transitional - XHTML 1.0
Same consideration as the HTML transitional doctype.
The Syntax:
CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Doctype #7: Strict - XHTML 1.0
Same consideration as the HTML Strict doctype.
The Syntax:
CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Doctype #8: Frameset - XHTML 1.0
Same consideration as the HTML Frameset doctype.
The Syntax:
CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
Advanced Doctypes
Notice: These are the very newest doctypes, and there are many browser that do not understand them. I had to take this information almost directly from About.com... I didn't know much about these ones.
Doctype #9: Unnamed Doctype - XHTML 1.1
XHTML 1.1 takes XHTML 1.0 and modularizes it. It allows you to take your XHTML and define only the tags that you want defined in your page. It's very similar to XHTML 1.0 Strict, but removes some of the presentation features.
The Syntax:
CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
Doctype #10: Unnamed Doctype - XHTML 2.0
This doctype is not meant to be backwards-compatible with HTML 4.01 or XHTML 1.1/1.0. It currently has limited support from browsers, but if you want to use it...
The Syntax:
CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 2.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml2.dtd">
Doctype #11: Unnamed Doctype - HTML 5.0
This one is taken directly from About:
HTML 5.0 is a conglomeration of Web Applications 1.0 and Web Forms 2.0. It was developed to try to address the needs of content authors and continue moving HTML forward, rather than worrying about whether it is valid XML or not. It is supported by browser manufacturers like Apple, Mozilla, and Opera.
The Syntax (VERY simple this time):
CODE
<!DOCTYPE html>
Alright, I'm kinda glad that's over. I just spent half an hour writing this, so i hope it helps someone, at least.
Also, just for you people that want my recommendation:
I almost always use the XHTML 1.0 Strict Standards.
