Mozilla & Positioning

  • Thread starter Shannon
  • 5 comments
  • 410 views
15,799
Mozilla seems to push the contents of a div layers down 15px. This is annoying as I have a Container div and I want create a footer at the bottom. IE will display it correctly, whilst Mozilla pushes it outside the container itself.

Here's the CSS code, and as you can see it's meant to be positioned 2px from the bottom.
Code:
div#Footer {
	position: absolute;
	left: 12px;
	bottom: 2px;
	height: 15px;
	width: 662px;
	}

Here's what I'm talking about. Anyway of working around this? :irked:
mozpositioning.png


BTW - That isn't the footer I was talking about, it's just an example.
 
Shannon,

have you tried setting the margins for you <body class="body"> to 0?


.body {margintop:0px;
marginleft:0px
...
}

or will that clash with your div?
 
I was thinking about that last night while i was talking to him. I knew it had something to do with margins, but for some reason i've made a habit of not saying what i think is wrong.. Haha.
 
I've noticed this too. It is starting to annoy me. On my site I have my navigation menu and my container div and everything after the menu is pushed down farther then the rest.
 
I've heard of a problem with Mozilla and adding extra junk to divs, but admittedly I haven't paid attention.

Now, it's hard for me to judge by your example pic, so I'll just ask outright: Is Mozilla adding 15px of padding, height, or margin to that division? And, is it just doing it to one side (if so, which side) or all the way around?
 
I worked out what the problem was. When you position something within a div, you have to use position: relative;.

Code:
div#Footer {
	position: relative;
	left: 12px;
	top: 471px;
	height: 10px;
	width: 662px;
	}

But now I have another problem, the user can't select any of the text within any of the divs for some strange reason. This was happening before I set it to relative by the way...:irked:

Edit: It appears as though all the layers were hiding under the Container. Just had to give the Container a z-index of 1 to solve it. Thanks Acid. 👍
 
Back