View Full Version : Weird Positioning Problem

09-08-2009, 01:30 AM
Hello Everyone,

I'm working on this fairly simple site and everything was going dandy. I even thought I would be done today it was going so well. Then I started having this weird problem where my parent div with no top margin detailed in CSS moves down when I place a top margin on a child div within it.

Through out the code I have several child divs with top margins and they work fine yet this one in specific doesn't want to play nice no matter where in the source code I place it. I can't seem to find any issues with the CSS either (not that am any kind of guru I might add)

You can look at the code by visiting http://users.onelinkpr.net/jcsaladin/bistrotruck/index.htm (http://users.onelinkpr.net/jcsaladin/bistrotruck/index.htm)

The divs in question are "footerInfo", "topLinks" and "bottomLinks". All divs are empty except the parent which has a background image in there. The other two had items in there but in troubleshooting I removed them to verify what the problem is.

If anyone could possibly point me in the right direction it would be great. Right now I'm just totally confused as to why this parent div picks up the top margin of its child div.


09-08-2009, 04:38 AM
add float:left ;

09-08-2009, 12:40 PM
add float:left ;

That worked great!!!Thanks!!!

Just for future reference. Could you explain why I needed the float for the parent div in this case. Was it the clear for the previous div?