Ok as far as I know, there are 3 different Doctypes. HTML 4.01 Strict HTML 4.01 Transitional HTML 4.01 Frameset I have a few questions now... 1) Which one to use? Strict or Transitional? 2) Where would I play the Doctype code? Before the <html> tag or inside it? 3) Would I use the same Doctype code for each website? For example if I wanted to go with Traditional, would I just copy and paste this code on every site and I'm done with Doctypes? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> Code (markup):
1. It's upto you. However, code has to comply what these doctype needs to validate. 2. Docytype should be the very first line of the document. 3. Again depends on you and your need to validate your document with a specific doctype. Not sure what you meant by "Traditional" however yes the same doctype can be copied and paste to another document.
Its the age of HTML5. You don't need those lengthy DOCTYPEs anymore, just start with <!DOCTYPE HTML> <html lang="en"> <head> <meta charset="UTF-8"/> <title>Page Title</title> </head> <body> </body> </html> Code (markup):
Modern web pages have no need for "transitional" and it should not be used. ALL new pages should use strict or, as @developerpanda pointed out, the new HTML doctype.
Regarding the new doctype. Does IE handle this okay? I assume all the real browsers do fine but wondering about IE.
Yes. Chris Wilson, lead developer for IE (who quit Microsoft and now works on Google Chrome), said a couple years ago that IE automatically goes into strict mode with this doctype.