Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Dmac77

macrumors 68020
Original poster
Jan 2, 2008
2,165
3
Michigan
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
 
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.
 
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.
 
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.
 
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 :) )
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.