Article: Choosing the right doctype for your site

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

aPaddedCell wrote:
Which Doctype should I use? This is one of the first questions people ask when they start using web standards. There are four main doctypes in use today. This artcile will firstly define what a doctype is and how it works, and then go on to explain the four types and help you to decide which one to use.

Post any comments, suggestions, questions etc. here. I hope you find the article useful! You can find it here:

Choosing the right doctype for your site

He has: 629 posts

Joined: May 2007

Quote: However, the problem is that browsers have never properly supported xhtml.

XHTML as XML seems to work fine here in Opera and Firefox.

Quote: One of the reasons to use a strict doctype is that you'll always get standards compliant rendering mode.

There is a bug in IE6 - If you include the XML declaration at the top of any XHTML document, or, indeed, even a comment at the top of XHTML or HTML, then IE6 switches to "quirks" mode. Fixed in IE7.

One final point; you raised the issue of character sets and encoding. Some people I know seem to think that you can make a document use Unicode by adding a "charset=utf-8" declaration on the page. Unfortunately, saying it is so does not make it so. I hope your readers will take the time to read the Tutorial: Character sets & encodings in XHTML, HTML and CSS that you thoughtfully included as a reference.

Cordially, David
--
delete from internet where user_agent="MSIE" and version < 8;

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

David,

I did mention that about the xml declaration. Maybe you missed it. You're right about the browsers have never properly supported xhtml bit, I should have caught that.

He has: 629 posts

Joined: May 2007

Sorry. I did miss the bit about the xml declaration.

I also failed to thank you for a great effort in explaining this difficult and contentious subject. Well done!

Cordially, David
--
delete from internet where user_agent="MSIE" and version < 8;

JeevesBond's picture

He has: 3,956 posts

Joined: Jun 2002

This is indeed a controversial subject, good article though. Think Megan's choice to recommend XHTML is a good one, there are some issues when it's served as the correct MIME type. If someone understands the MIME type issue, they're probably going to understand the requirements of serving as XML too.

I'm a bit annoyed with all the proponents of going back to tag soup, just because IE doesn't support XML properly! Smiling

a Padded Cell our articles site!

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.