How does one decide which doctype is right for him/her?
What are the benefits of each?
Which do you use?
And any other questions will follow...
EDIT:
Why doesn't everyone use XHTML doctypes?
Doctype.
Moderator: General Moderators
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
You decide which doctype to use based on what you plan to do with your site. What content you will serve. You'll have to do some research on this, there isn't an easy answer to this.
A good starting point are the articles Roger Johansson wrote about the subject, like HTML vs. XHTML on standards compliant websites
Or what Anne van Kesteren writes
In short: there are no real benefits of XHTML vs HTML. It's more important to use a strict doctype vs a loose one because of the strict rendering mode of browsers. A few years back XHTML was all the hype but that has passed now people realize the disadvantages (or lack of advantages).
A good starting point are the articles Roger Johansson wrote about the subject, like HTML vs. XHTML on standards compliant websites
Or what Anne van Kesteren writes
In short: there are no real benefits of XHTML vs HTML. It's more important to use a strict doctype vs a loose one because of the strict rendering mode of browsers. A few years back XHTML was all the hype but that has passed now people realize the disadvantages (or lack of advantages).
- The Phoenix
- Forum Contributor
- Posts: 294
- Joined: Fri Oct 06, 2006 8:12 pm
The first comment is inaccurate, and the second clarifies why.matthijs wrote:In short: there are no real benefits of XHTML vs HTML. It's more important to use a strict doctype vs a loose one because of the strict rendering mode of browsers. A few years back XHTML was all the hype but that has passed now people realize the disadvantages (or lack of advantages).
There are real benefits to XHTML v. HTML, but the disadvantages are substantial.
The key benefits are related to machine parsing - easier to create, and easier to consume. The key disadvantages are unfortunately huge - incompatibility with the majority share web browser unless you take special steps to avoid it (and even then, you lose some of the benefits).
It has advantages. Large advantages. Once Microsoft fixes the XHTML+XML app issue in IE8(or later?), I predict you will see a substantial move to embrace those advantages.
In the meantime, 80% (as they say) of the advantages can be had with 0% of the disadvantages - a worthwhile compromise for most.
hmm... very interesting matthijs. I often find myself doing something simply because "the internet told me to". I never really stopped to consider why I should or shouldn't be using xhtml. I just kind of used it when I knew I could get away with it. After about an hour of surfing your links (and related) I have decided to switch to html 4.01 Strict whenever possible and html transitional only if I really need to. Thanks! 
What I mean is there are in most cases no real - practical - advantages. And that is accurate in my opinion.The first comment is inaccurate, and the second clarifies why.
(it stays difficult to write in a non-native language..)
Ninja: indeed. I used to follow what the web guru's did. Slap on an XHTML strict doctype, put on that xhtml valid badge and think I was ok. It's only when you do some more reading you start to realize it's not that simple
For me a html4 strict doctype works fine as well.