Jump to content

Differing Layout between XHTML Strick/Transitional


cags

Recommended Posts

First off, I couldn't decide whether to put this in here of CSS, it's technically a styling issue, but it's caused by the DOCTYPE declaration, which I consider to be more a HTML issue.

 

Please feel free to correct me if I'm wrong, but it was my understanding that the objective of a DOCTYPE declaration was to specify a set of rules that a document must follow. These rules consist of a list of required tags & attributes including where and in what format they should be placed, along with a list of allowed tags/attributes that can be used. Therefore any document that will validate against XHTML 1.0 Strict will automatically validate against XHTML 1.0 Transitional, since the only difference is that Transitional will merely allow a few extra (transitional) tags. Therefore it was my understanding that if I was to change the DOCTYPE of a document that will validate against XHTML 1.0 Strict to XHTML 1.0 Transitional there should be no issues at all. Indeed when I tried it on my test project everything still validated fine. The problem I'm encountering is that the layout of my page is slightly different and I can't for the life of me work out why.

 

It was my belief that the DOCTYPE itself should not effect layout at all. Out of the browsers I've tested the issue arises in Chrome and Safari, but not in IE or FireFox. Here are example links for the two documents. Take note of the gap between the menu and the header image.

 

Strict

Transitional

 

Incidentally I've since fixed the erroneous gap by changing the img tag to 'display:block'. But I'm still curious as to why there's a difference. It's althought Chrome/Safari use a different stylesheet for the two DOCTYPEs, but surely there would be no reason to?

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.