Strict vs. Transitional Doctypes |
Strict vs. Transitional Doctypes |
jimlongo |
Sep 29 2006, 03:28 PM
Post
#1
|
This is My Life Group: Members Posts: 1,128 Joined: 24-August 06 From: t-dot Member No.: 16 |
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 |
Sep 29 2006, 03:53 PM
Post
#2
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
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 |
Sep 29 2006, 04:13 PM
Post
#3
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,731 Joined: 9-August 06 Member No.: 6 |
|
Darin McGrew |
Sep 29 2006, 04:31 PM
Post
#4
|
WDG Member Group: Root Admin Posts: 8,365 Joined: 4-August 06 From: Mountain View, CA Member No.: 3 |
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 |
Sep 30 2006, 05:16 PM
Post
#5
|
This is My Life Group: Members Posts: 1,128 Joined: 24-August 06 From: t-dot Member No.: 16 |
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 ) 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 |
Sep 30 2006, 05:35 PM
Post
#6
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
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. 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 ) 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 |
Sep 30 2006, 05:59 PM
Post
#7
|
This is My Life Group: Members Posts: 1,128 Joined: 24-August 06 From: t-dot Member No.: 16 |
Okay thanks for that one . . . I'm going to try converting more of my pages in the next little while and see how
This post has been edited by jimlongo: Sep 30 2006, 06:02 PM |
pandy |
Sep 30 2006, 10:11 PM
Post
#8
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,731 Joined: 9-August 06 Member No.: 6 |
Don't let them discourage you. 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.
|
Lo-Fi Version | Time is now: 26th April 2024 - 01:08 PM |