Welcome to WebmasterWorld Guest from 18.205.176.85

Forum Moderators: open

Message Too Old, No Replies

Firefox and doctype problems

     
2:02 am on May 18, 2005 (gmt 0)

Junior Member from US 

10+ Year Member

joined:Jan 27, 2003
posts:127
votes: 0


Have a site that I am finishing up and discovered problems with the doctype and Firefox 1.04.

I validated both the CSS and HTML with W3C - everything checks out except the colored scrollbar CSS. (This is not the problem because when I remove it from the code, nothing changes)

I am using <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> as the doctype.

Displays fine in IE 6.0 and fine in Firefox 1.04, BUT as soon as I add the above doctype, Firefox totally trashes all formating.

BTW-I tried changing the doctype to "strict," but it does not make a difference.

[edited by: tedster at 3:31 am (utc) on May 18, 2005]

3:38 am on May 18, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:May 26, 2000
posts:37301
votes: 0


What happens when you go from no doctype to adding a full doctype is that modern browsers switch from "quirks mode" to "standards mode". You can get a good first idea about the differences here:

[webmasterworld.com...]

A quick fix is to use a "partial" DTD, without the url section at the end - like this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

That will leave the site in quirks mode. But even better is to understand the differences and work out totally standard mark-up.

4:37 am on May 18, 2005 (gmt 0)

Junior Member from US 

10+ Year Member

joined:Jan 27, 2003
posts:127
votes: 0


Ted,

thanks for the tip - it worked. Sorry about the "sticky." I was frustrated. The code and CSS is W3C compliant, so I don't know why the problem. How come they don't explain the quirks mode on their site? Is this frowned upon?

5:11 am on May 18, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:May 26, 2000
posts:37301
votes: 0


The W3C is the body that recommends standards - but they have nothing to do with quirks mode. That is something that the browser makers came up with, begninning with Microsoft.

IE in particular had been doing things in such a non-standard way that people's web pages often DEPEND on the non-standard behavior. So instead of just jumping into standards-only, quirks mode and doctype switching was developed as a way that older pages can still work on modern browsers.