Help - Search - Members - Calendar
Full Version: Strict vs. Transitional Doctypes
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
jimlongo
So I've read numerous times why i would want to use a strict doctype.
http://hsivonen.iki.fi/doctype/
So I thought I'd give it a go and change some doctype declarations on my pages and see what happens. I didn't get very far.

Take this simple entry page to my website. It uses a transitional doctype and on a Mac it all looks fine. A solid image generated by slices in a table. Note - there is music automatically playing so for those that are allergic to such a thing turn down your speakers (although if you have javascript disabled you won't have to worry)
here is the site with a transitional doctype - http://rdiv.com

Here is the same page with a strict doctype . . . http://rdiv.com/index2
On every mac browser it is as if there is all kinds of whitespace in the table generating the image. There isn't any whitespace. There isn't anything fancy here, I added a simple in-line style declaration but it doesn't seem to matter. It's just the table with some rollovers.

What is it that breaks these pages?
Is this the case on Windows as well?
Am I overlooking something simple - what standard am I breaking?


Thanks in advance for your time.
Jim




Christian J
QUOTE(jimlongo @ Sep 29 2006, 10:28 PM) *

So I've read numerous times why i would want to use a strict doctype.
http://hsivonen.iki.fi/doctype/


Digression: personally I prefer the terms std mode and quirks mode doctype, since the following transitional doctypes puts most browsers (except Konqueror) in std mode:

CODE
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">


QUOTE
What is it that breaks these pages?


It might be http://developer.mozilla.org/en/docs/Image...Mysterious_Gaps

QUOTE

Is this the case on Windows as well?


I see gaps in FF and Opera but not IE.
pandy
QUOTE(jimlongo @ Sep 29 2006, 10:28 PM) *

Thanks in advance for your time.


You are welcome! laugh.gif

Christian speaks the truth. Strict Mode is a misnomer. Basically a complete doctype with a URL triggers Standards Mode.

Have to rush. It's Friday and I'm out carousing. IPB Image
Darin McGrew
Yes, there really are two issues. Henri Sivonen's article talks about choosing a doctype declaration that triggers the desired rendering mode (standards, almost standards, or quirks).

The Strict vs Transitional issue is more or less independent of the rendering mode issue.

Regarding the OP's site, if you're going to stick with old design styles (images glued together with tables, linked images and images of text with no ALT text), then go ahead and stick with old markup. If you're going to upgrade to newer markup, then you should move to real text and flexible CSS-based designs as well.
jimlongo
QUOTE
QUOTE
QUOTE
What is it that breaks these pages?

It might be http://developer.mozilla.org/en/docs/Image...Mysterious_Gaps

Thanks for that, this fixes this table based design in all these standards compliant browsers I have. Funny that the one that didn't have a problem with this was the non-standards compliant Explorer. Could you please tell me if this still renders okay in Windows Explorer (without any white spaces). http://rdiv.com/index3

I guess part of this exercise illustrates a point I think we need to be more careful with. Often I see recommendations here to use a strict doctype, thus triggering standard mode (I get the semantics biggrin.gif ) for designs that clearly that mode is going to cause troubles with. And wishing that a lot of these pages would be built with a more modern CSS approach is really wishful thinking at this point in many peoples development.
Christian J
QUOTE(jimlongo @ Oct 1 2006, 12:16 AM) *

Could you please tell me if this still renders okay in Windows Explorer (without any white spaces). http://rdiv.com/index3


Looks OK in IE6. Now that I listened to the music it sounds nice too. smile.gif

QUOTE
I guess part of this exercise illustrates a point I think we need to be more careful with. Often I see recommendations here to use a strict doctype, thus triggering standard mode (I get the semantics biggrin.gif ) for designs that clearly that mode is going to cause troubles with.


But what else can you do? You'll never learn proper CSS with a quirksmode (or even an almost-std) DTD. And with a quirksmode DTD you'll get even more different results in different browsers. You'll also get problems with table layouts in quirksmode, like inheritance:

CODE
div {
color: red;
}

<div>
<table>
<tr>
<td>DIV color is not inherited in Windows IE5 or IE6/quirksmode</td>
</tr>
</table>
</div>


jimlongo
Okay thanks for that one . . . I'm going to try converting more of my pages in the next little while and see how painful painless that might be.
pandy
Don't let them discourage you. rolleyes.gif Standards Mode is easier and so is using a Strict doctype. I joke you not. As Darin said, less browser differences and also fewer things to keep track of. That's the truth. smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.