PDA

View Full Version : What Should I Set as my DOCTYPE?




Dmac77
Jun 29, 2009, 12:08 AM
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?

Thanks,

Don



TodVader
Jun 29, 2009, 02:00 AM
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.

design-is
Jun 29, 2009, 04:27 AM
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.

angelwatt
Jun 29, 2009, 09:59 AM
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.

wheezy
Jun 29, 2009, 10:27 AM
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 (http://cameronmoll.com/archives/2009/06/coding_like_its_1999/) - Cameron Moll

Switched (http://mezzoblue.com/archives/2009/04/20/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 :) )

design-is
Jul 2, 2009, 08:03 AM
Just wanted to point Weezy's and others to a counter point from Drew McLellen (http://allinthehead.com/retro/343/the-fallacy-of-page-zooming) where he responds to Cameron’s choice.

::Scott::
Jul 12, 2009, 06:23 AM
This is the best article that I have found about DOCTypes:

http://www.resultswebdesign.com.au/web-design/technical/doctypes/