Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:13

Doc type effects menu offset in IE - driving me nuts!


Poster: wilydunk
Dated: Sunday February 26 2006 - 22:47:40 GMT

Using the following doc type causes IE to have a weird offset (circa 18 pixles underneath the link) on the most simple of code:


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

</head>

<body >


<SCRIPT language=JavaScript src="./menus/milonic_src.js" type=text/javascript></SCRIPT>
<script language=JavaScript>
if(parent.frames.length){top.location=document.location}
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=./menus/mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=./menus/mmenudom.js><\/scr"+"ipt>");
</script>


<img src="./i/placer.gif" id="tester" /><a href="#" onmouseover="popup('test','tester')" onmouseout="popdown()">TEST</a>

<script>

with(dropdownstyle=new mm_style()){
bordercolor="#5b6f7b";borderwidth="1";
borderstyle="solid";
}

with(milonic=new menuname("test")){
style=dropdownstyle;
aI("text=tester;url=software.asp?pg=57;showmenu=tester;");
}


drawMenus()</script>



</body>
</html>



Removing the doc type solves the problem (but creates others) and I WANT that doc type for the site.

Are they any know 'issues' or work arounds?


Poster: Migru
Dated: Monday February 27 2006 - 8:19:47 GMT

Hi

don´t know if a doctype setting is doing standardizing margin settings, which normally should be accomplished in the head section by style or reference to css containing the style .

Michael

something like

Code:
<link href="yourfilename.css" rel="stylesheet" media="screen">


and in the yourfilename.css file (with some other styles) that one (simplest )
Code:
body { margin: 0px }


hope that helps


Poster: vikenk
Dated: Monday February 27 2006 - 13:18:03 GMT

Hi,

Does the use of the doctype affect Firefox/Netscape/Opera? Using a doctype forces IE to "standards-compliant" mode, where it would normally be in "quirks" mode. Standards Compliant mode in IE really affects what's called the "box-model", and things you designed before adding a doctype may look different.

If you designed this site for IE then added the doctype afterwards, then I can see why you are having this problem. Try looking in your css file (if you have one) for any styles affecting tables, <td>, or <body> margins, padding, or sizing.

The code you supplied in your post isn't quite enough to make a proper diagnosis. If you could supply a url to the problem site or a url to your css sheet, that would be helpful.


Poster: wilydunk
Dated: Monday February 27 2006 - 13:20:41 GMT

Thank you!!! Great stuff - I'm not sure what the doc type does to the margins in IE but setting it all to zero on the body works a treat.

The site is designed to do cross browser - and in Opera/Netscape/FF all worked fine. Annoyingly on my live site the body DOES have the margin set - but not to zero - and this still causes the problem. Making it zero and setting the margins on a "wrapper" class around the content does the job though.

Cheers!


Poster: Migru
Dated: Monday February 27 2006 - 14:12:14 GMT

Hi

these reflections on "box model" bug etc. I don´t think that they are, at this point applicable. The margin settings, which you find on/at practically all page settings of websites are simply necessary to standardize the zero point, as the browsers start counting pixels different. (As far as I´m informed). So the margins may be set individually (top,left,bottom,right) or just as it is in this case, to zero (or any other reasonable value) for all four.

If I find it, will provide a link on this

Michael