I noticed that Visual Studio defaults the DOCTYPE to XHTML 1.0 Transitional. This seems okay, but I think that’s more of a standard for “generation 6” browsers. We’re now in gen 7 and 8 browsers, and I’m wondering what DOCTYPE I should be putting in my HTML.
On a related note: Is there a way to add other DOCTYPEs to the HTML validation in Visual Studio 2008? Tools > Options > Text Editor > HTML > Validation
is the way to go. This works fine in all decent browsers, including IE6 (not that it is a decent one though). Also see http://hsivonen.iki.fi/doctype/ for more background info and a browser behaviour table.
You could also consider XHTML strict, but why would you massage clean HTML into a XML format? It is only interesting if you want to parse/generate/validate HTML using some XML tool, which often isn’t the case in real world. Google also just uses
<!doctype html>and Stackoverflow uses nicely HTML strict.