News:

SMF 2.1.6 has been released! Take it for a spin! Read more.

Main Menu

DOCTYPE causes custom menu weirdness

Started by Mike Bobbitt, September 09, 2004, 07:29:26 AM

Previous topic - Next topic

Mike Bobbitt

First off, this is not technically an SMF problem, I'm just hoping someone can shed some light on this problem. :)

I've added some custom JS menus to my forums. They work fine in IE, but in FireFox, the DHTML popup always appears in the upper left corner (not under the menu as expected).

Now the weird thing is that if I remove this line from index.template.php:

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


The menus will work fine in Firefox... but the text size jumps up a notch in IE. :( (I know, I don't want to remove the doctype line, but I had to narrow down the cause...)

Here's the URL: http://army.ca/forums

Anyone know why the doctype line is munging the menus in FireFox? Or what I can do about it?


Thanks
Mike

[Unknown]

Removing that line makes Firefox use quirks mode.  This probably means the html, javascript, or html outputted by the javascript is buggy.

-[Unknown]

A.M.A

I've experienced some problems with using the doctype tag in (IE) .. do not know the cause though .. am guessing IE wants only <html> to be the starting tag  .. some <div> will not work right .. custom color scrolling bars as well.

but with FireFox I guess it should work fine unless as [Unknown] said.
Really sorry .. real life is demanding my full attention .. will be back soon hopefully :)

Mike Bobbitt

Thanks [Unknown], that makes sense. I've modified my template to put out a less strict DOCTYPE for non IE browsers, but will shoot for finding and fixing the root bug.

Cheers

[Unknown]

Quote from: A.M.A on September 10, 2004, 07:43:03 AM
I've experienced some problems with using the doctype tag in (IE) .. do not know the cause though .. am guessing IE wants only <html> to be the starting tag  .. some <div> will not work right .. custom color scrolling bars as well.

but with FireFox I guess it should work fine unless as [Unknown] said.

Quirks mode has many side effects, such as treating the width of an element differently (when that element has padding/margin) than expected.  IE only supports the DOCTYPE going first, and if it is not the very first bytes of the file, quirks mode is used.

Both IE and Mozilla Firefox have quirks modes.  They are not exactly the same, though.

For example, this forum gives IE the doctype and everything works fine... unless you're in an older browser, which doesn't know about standards compliance mode.

-[Unknown]

Advertisement: