# Solved: Padding Differences Between Internet Explorer & Firefox



## TW.87 (Dec 30, 2005)

G'day,

I'm working on a new website at the moment (that you can see here: http://2008.rickkelly.com.au/[Global]/Global(Assets)/Global(Heading).php), and I am having some small problems with padding differences between Internet Explorer and Firefox.

The differences I am talking about can be seen with the drop-down navigation menu, as it appears further to the right of the corresponding button in Firefox than the display in Internet Explorer (which is how I want it to display).

As well as that, the form field there is not displaying evenly between the two browsers. Neither are showing up correctly. I know it's a simple fix, but for the life of me, I can't work it out.

Any help would be greatly appreciated!


----------



## tomdkat (May 6, 2006)

TW.87 said:


> The differences I am talking about can be seen with the drop-down navigation menu, as it appears further to the right of the corresponding button in Firefox than the display in Internet Explorer (which is how I want it to display).


It looks like a JavaScript issue. The getposOffset() function might be the culprit:

```
function getposOffset(what, offsettype)

	{

	var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;

	var parentEl=what.offsetParent;

	while (parentEl!=null)

	{

	totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;

	parentEl=parentEl.offsetParent;

	}

	return totaloffset;

	}
```
This is where that function is called:

```
function GlobalNavigationActive(obj, e, menucontents, menuwidth)

	{

	if (window.event) event.cancelBubble=true

	else if (e.stopPropagation) e.stopPropagation()

	clearhidemenu()

	dropmenuobj=document.getElementById? document.getElementById("GlobalNavigation") : GlobalNavigation

	populatemenu(menucontents)

	if (ie4||ns6)

	{

	showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)

	[b]dropmenuobj.x=getposOffset(obj, "left")[/b]

	[b]dropmenuobj.y=getposOffset(obj, "top")[/b]

	dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
	dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"

	}

	return NavigationSystem()

	}
```
getposOffset() is apparently returning and "x" value that is different in Firefox than in IE and possibly other browsers. I'm not sure how to "fix" the issue, at least not right now. 

]quote]As well as that, the form field there is not displaying evenly between the two browsers. Neither are showing up correctly. I know it's a simple fix, but for the life of me, I can't work it out.
[/QUOTE]I can barely see the form field in either IE6 (Maxthon 2.0.8) or Firefox 3.0b3. So, I added some borders to the table that contains the form and it appears to be positioned the same in both browsers. The text above the form was positiioned differently but the form field itself seems to be consistently positioned. The form field starts with the "@" sign below the "sign-up" text.

Attached are screenshots.

Peace...


----------



## TW.87 (Dec 30, 2005)

Thanks for the help there.

I'll keep fiddling with it and see whether I can come up with something.


----------



## Fyzbo (Feb 6, 2002)

I don't know if it's affecting anything, but get rid of the comments on the top. Browsers expect the doctype to be the first line on the page, if it's not they may go into quircks mode.


----------



## TW.87 (Dec 30, 2005)

Fyzbo said:


> I don't know if it's affecting anything, but get rid of the comments on the top. Browsers expect the doctype to be the first line on the page, if it's not they may go into quircks mode.


That fixed it! Thank you so much!


----------



## tomdkat (May 6, 2006)

Fyzbo said:


> I don't know if it's affecting anything, but get rid of the comments on the top. Browsers expect the doctype to be the first line on the page, if it's not they may go into quircks mode.


Great call! :up:

Peace...


----------



## rick22 (Feb 28, 2008)

hey people thanx...
i was looking for an answer for this problem from quite some time..


----------

