validator.w3.org - Post ID 74008

User 463058 Photo


Ambassador
1,086 posts
Online Now

And this is the complete doctype you should use to prevent quirks mode, as Bill mentioned.

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


Registered User
72 posts

BillR.

you are brilliant! ..........thank you so much. :D
Thanks to you I now have the perfect template to work from.

Cary, I have added the code as you suggested, would you mind explaining to me excatly whats its purpose is?

Thanks in advance.





User 78330 Photo


Registered User
198 posts

This problem should really have been sorted out by now.

Open a new page and it defaults to:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> and you get XHTML mark up. ie: <br />

Set the new page to default to:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> and then the mark up would be correct.

Is there any possibility of getting the correct code context for different DocType declarations please.

If the problem does get corrected any time in the future could we also have an alternative 'xhtml1-loose.dtd' please.
User 463058 Photo


Ambassador
1,086 posts
Online Now

JaneA wrote:
Cary, I have added the code as you suggested, would you mind explaining to me excatly whats its purpose is?

Thanks in advance.


The doctype you had was valid, but it was incomplete. It needs to be both complete and valid if you want your pages to look as consistent as possible from one browser to the next.

If the doctype is either invalid or incomplete, IE will use quirks mode to render things. In part this means IE would use IE5's broken CSS box-model which doesn't correctly interpret widths, padding, and margins. IE also won't respect the use of auto margins for centering.

I see you've added the use of the DHTML menu to your page. Unfortunately, it wasn't written to work in standards mode (basically, the opposite of quirks mode), so it won't show up in Firefox or Opera when using the full doctype I suggested.

You can either change your doctype to what you had originally and deal with IE's quirks mode, which may not be much of a problem if you aren't using CSS for everything, or you can replace the DHTML menu's DAT file as discussed in the following thread.


http://www.coffeecup.com/forums/our-des … a-browser/
User 463058 Photo


Ambassador
1,086 posts
Online Now

JaneA wrote:
Yes Bill, IE8 is what is bothering me to be honest,

I read an article that they are going to be displaying sites to the validator.w3.org standred and therefore older site will have to put in a fix to display websites under IE7 rules if they are not validated.

If this article is true then it is Kinda worrying if you create sites for businesses’ like myself


The beta is too buggy to test reliably, but pages shouldn't have any trouble displaying in the final release if they don't use hacks. Websites coded to display correctly in IE 7 but not other browsers will need a special meta tag added after the opening head tag, I believe... Something like this:

<meta http-equiv="X-UA-Compatible" content="IE=7"/>
User 355448 Photo


Ambassador
3,144 posts

Cary wrote:


I see you've added the use of the DHTML menu to your page. Unfortunately, it wasn't written to work in standards mode (basically, the opposite of quirks mode), so it won't show up in Firefox or Opera when using the full doctype I suggested.


Cary,

I have the DHTML menu working on my sites using the following doctypes:

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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

The DAT file just needs a little adjusting.
User 355448 Photo


Ambassador
3,144 posts

JaneA,

I see that the DHTML menu is displaying in the bottom left corner with Firefox. That can be fixed with a replacement DAT file. Another member of this forum helped me with making the changes. If you want the DAT file, you can download it at http://www.coffeecuphelp.com/broberson/dhtmldat.exe and run the self-extracting zip file. You will find a readme file that explains how to replace the DAT file.
User 463058 Photo


Ambassador
1,086 posts
Online Now

BillR wrote:
Cary,

I have the DHTML menu working on my sites using the following doctypes...


Hi Bill,

The link at the end of my post actually points to a thread where you gave instructions for updating the DAT file and the menu code so it would work. :)
User 355448 Photo


Ambassador
3,144 posts

Cary,

oops. Guess I shouldn't be trying to do something that requires thinking after I get out of class. :)

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.