What Should I Set as my DOCTYPE?

Discussion in 'Web Design and Development' started by Dmac77, Jun 28, 2009.

  1. Dmac77 macrumors 68020


    Jan 2, 2008
    Hey guys,

    I'm just wondering what I should use as my DOCTYPE when creating webpages. Should I still use XHTML 1.0 Transitional, or should I start using XHTML 1.1? Does it even matter?


  2. TodVader macrumors 6502a


    Sep 27, 2005
    Quebec, Canada
    I use XHTML Strict for one reason:

    I love the concept of separating the content from the container and separating the style from the container. By keeping everything separate, you have much more flexibility with what you can do with each part.

    As for the DOCTYPE, it's a way to tell the browser what to expect and how to output it.

    It also serves as a guideline to finding errors in you code with validators.

    If you are starting, you might as well use XHTML, you'll be happy you did it in the future when you want to make changes.
  3. design-is macrumors 65816


    Oct 17, 2007
    London / U.K.
    Yup, strict is the way to go :)

    However, if you are going to integrating with a cms of some sort, consider transitional so that any transitional html the editor puts in when the client makes changes are catered for.
  4. angelwatt Moderator emeritus


    Aug 16, 2005
    I generally use XHTML 1.0 Strict. Don't worry about XHTML 1.1 though. It'll be passed over by most. In the coming years I think XHTML5 will likely be used over XHTML 1.0/1.1/2. It's also perfectly fine to use HTML 4.01 Strict (and later HTML5). I do feel people should strive for Strict unless they have reason they can't, like those given by design-is. We can't always control every aspect of the code we use. Oh, and Transitional isn't bad, but it is meant to be a transition to strict.
  5. wheezy macrumors 65816


    Apr 7, 2005
    Alpine, UT
    I'm an XHTML Strict 1.0 kind of a guy, but here's an argument I came across yesterday from a pretty respected guy in the field (Cameron Moll), who also cites another respected guy in the field (Dave Shea - creator of CSS Zen Garden)

    Coding like it's 1999 - Cameron Moll

    Switched - Dave Shea

    I'll be thinking this over myself this week, and maybe give HTML 4.01 the thumbs up for my future coding adventures.

    Nevertheless, whichever you go with, make sure it validates. Google things you need to fix, spend a little more time making sure it does, but make sure it validates. I've had so many less browser errors and fixes that I've had to do since being comfortable creating valid code. ( I know, I know, my own home page doesn't validate - it's that twitter js I added, just haven't had time to fix it :) )
  6. design-is macrumors 65816


    Oct 17, 2007
    London / U.K.
  7. ::Scott:: macrumors newbie

    Jul 12, 2009

Share This Page