Which Doctype is for me?
June 25th, 2008
This is yet another thing that has been bothering me for quite some time now, that I just haven’t had the will power to address it. Well, I think it has pushed me over the edge. Why are people using Transitional DOCTYPES for new projects?
Stop and think about the title for a minute, would you please!
T-R-A-N-S-I-T-I-O-N-A-L It does not say “use this DOCTYPE if you are lazy“. No. This clearly states that it should be used for, wait for it, transitioning from legacy content that probably did not have a DOCTYPE to begin with, and now does to help give some order to the confusion. They are also there to say “hey, we have some presentational elements mixed within the markup”.
Taken from w3.org
This is the HTML 4.01 Transitional DTD, which includes
presentation attributes and elements that W3C expects to phase out
as support for style sheets matures. Authors should use the Strict
DTD when possible, but may use the Transitional DTD when support
for presentation attribute and elements is required.
When is this required you may ask? As stated above, when you are dealing with legacy content that is out of your control for the most part, as far as formatting goes. This definition clearly tells you out right to use a Strict DOCTYPE when at all possible. Still not convinced?
Write Strict, go Transitional later
If you are designing a site that is going to end up on some CMS, with a lousy good for nothing WYSIWYG editor (like I have been battling for the past 2 years at my current job…) then my hat is off to you and I share in your pain. I still will design the layout with a Strict DTD, saving the Transitional switch for later when it is time to hand the site off to be populated. The CMS we use is out of our hands as far as having access to the formatting of the cotent, for the most part. We have been looking into limiting the editor down to basic functionality.
I can’t tell you how many times I have written extensive style sheets for users, taking careful consideration into all necessary styles that might be needed, and to come back 3 months later and see comic sans font mixed with courier, extra-large bright green font! You destroyed my layout!!! But, as is life, it is out of our hands.
Get to the root of the problem
If you do have access to the way your CMS formats data, you are in luck! Have at it. Get in there and get your hands dirty, to make some clean markup. You will thank yourself now, and the clients will thank you later.
If you are using a database to pull content, and your choice language to format it, even easier. It should not take much to re-work the way things are coming out to conform to a Strict DOCTYPE.
It is just a damn shame to go to some new sites from all the CSS Galleries out there, and to see oh 80-90% of them are using Transitional…WHY! What are you transitioning from? It is a brand new site, so unless transitioning to you means copying & pasting from Word, get a Strict DTD in there!
I will always give the author the benefit of the doubt and read through their markup a little bit, just to see why they might chose this burden, and most of the time I cannot find any good reason. Don’t choose Transitional based on your skill set, have some confidence. Producing good clean markup using a Strict DTD will help you out in the long run. You are basically writing yourself a ticket to any media you wish to display your site on. It will force you to become more independent of vices or clutches you used to use (like tables!).
If your site does not validate, take a minute or two to look up why exactly, and how you can fix it. That way the next time you run into this issue, you will know what is wrong, and nip it in the bud before it gets out of hand.
HTML 4.01 Strict
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
XHTML 1.0 Strict
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
If you use a Transitional DOCTYPE, please let me know why. I would love to know your reasoning.
- Posted at 9:49 am in web design
-
Leave a comment

ifoh designs | Which Doctype is for me?
Why you should not be using a Transitional DOCTYPE anymore!
Great article. I have started using Strict as default now. I am guilty however of starting new projects in Transitional, right up to about a month ago.
It’s interesting that you point out the “transitioning from legacy content” - I’d never thought about that, or the reasons for Transitional at all.
The other day I was coding a site up in Strict when my boss came along and said “That link needs to open in a new window.” What a pain that was, but I still carried on the job in Strict and changed to Transitional at the last possible moment.
You make a good point well.
//Harry
your preaching to the choir. if you are using static HTML/XHTML then strict DTD is all well and good. dynamic sites cannot use strict when dynamically generating the HTML/XHTML code because the language does not follow the web standards, thus forcing you to use “transitional” to get the pages to render correctly. Also most people who know and care about web standards are already using them correctly. this excludes most programmers i know who only seem to care about best practices in their development language. the only way to have dynamic pages that also adhere to web standards is to hand code them, which goes against the adage that “programmers are lazy.” as a web/graphic designer i both agree and disagree with you. though “strict” should be the DTD most heavily used, it’s not always practice for deadlines and development of dynamic sites. if it truly bothers you that much then perhaps you should stop viewing the source of pages, i personally had to stop due to WYSIWYG tag soup generated by dreamweaver and .NET developers alike, not to mention all the CMS horror that a pages code endures.
“Why are people using Transitional DOCTYPES for new projects?”
There is a very simple reason for it….it’s the default doc type in Dreamweaver, and most people seem to ignore it/not paying attention to it.
Ross
I was into your response, right up until the point where you said this:
That is just out of sheer “laziness” and not the “lazy yet effective” programming habits we should be using.
If you are writing the output code yourself, and you cannot do this because of a “deadline”, you need to step back to the books and brush up a bit. This should be second nature to us, not a hassle, and a “if I have time” type of thing.
Also, as far as dynamically generating content, if you are referring to a CMS, or alternative platform, then that is an issue you can try to deal with (make it produce valid markup) or use a transitional DOCTYPE…or invest in a new application.
Thanks for the comments!
Matt,
I whole heartedly agree!
I was merely playing devils advocate to answer the question you posed as to why the transitional doc type is still in use.
No DOCTYPE for me, please.
lol @ Little Bear. try adding some kind of doctype to your websites and see how they all fall down when browsers start interpreting the code the way they should not the quirks way
xhtml strict all the way for me
Great post Matt!!
You couldn’t have put it better. Let me add here that there are ways NOT to go Transitional, for simple things like embedded elements and inline javascripts that we face often while coding. There are great online resources about the Strict validation of somewhat ‘difficult’ elements. Search before you give up.
Again, thumbs up! Great Post!
I have to say this is a pretty valid point I’ve not even considered before. I’m so used to just copying and pasting my default info from my other sites for so long, I’ve never really considered moving over to strict - even though I know the majority of my sites would validate.
I’ll heed your words wisely and make a move on up. I’m redesigning my site and blog at the moment so I’ll change that DOCTYPE to the one my code deserves.
It’s also worth mentioning that HTML 4.01 Strict is still preferred by many over XHTML anything.
http://www.webdevout.net/articles/beware-of-xhtml
[…] found this quite good: ifoh designs |
[…] 21- Which Doctype is for me? […]
I think that what Mark (#11) points out it’s extremely important: along with the question of “why are you/we using transitional doctypes”, there should be “why are you using xhtml”… are you/we using MathML or SVG? Do you absolutely require a XML parser? Do you serve your XHTML as application/xhtml+xml instead of text/html?
You could actually write an entire book about this (I actually wrote a somewhat lenghty post on my blog, but it’s in spanish), but to sum up, if you really want to stick to standards as if they are your creed, you have to choose the right doctype, serve your files with the correct mimetype and check how will the different browsers parse your content.
So, if you want to stick to strict XHTML, serve it as application/xhtml+xml and be conscious that an unencoded ampersand could break your entire site.
If you want to serve your files as text/html, use HTML or transitional XHTML, but you should know that browsers usually treat these as tag soup anyway, so…
Marc and Felipe - thanks for chiming in with that. I’ve read a bunch of stuff related to the “dark side” of xHTML for documents that are only html (an article by Tommy Olson started it for me quite a while ago), and I resolved to stay with strict html 4 for any new projects, but *everything* you see in tutorials online, but people I respect, seems to be xHTML so I questioned my decision. I’d love for there to me some more consensus. Strict vs. Transitional shouldn’t even an issue as far as I’m concerned. But HTML 4.01 vs. xHTML seems less clear.
oops. Sorry Tommy - I knew there was a double “s” in Olsson.

http://www.autisticcuckoo.net/archive.php?id=2005/03/14/xhtml-is-dead
very interesting blog, even though I don’t use dreamweaver I do use the Transitional vs of Doctype though never knew what it was meant for really until now ;). However w3c’s own banners are not even valid so screw them LoL. Might go try out for Strict docs even though I’m just a junior coder.