...

View Full Version : firefox nested div problem



el_muerte2
05-13-2008, 07:08 PM
I am building a page with a centered layout using divs nested inside a larger wrapper div (same height, uses full screen width) using a style similar to

#div-1 {
position:relative;
height:100px;
width:100%;
}
#div-1a {
position:relative;
height:100px;
width:750px;
}
where #div-1a is centered inside #div-1. It renders fine in IE6, in Firefox there is a large gap (20px or so) from the top of the page. If i set position:absolute in #div-1 it sits tight to the top of the page in both browsers however the #div-1a still sits 20px lower and overlaps into the next div. If I make overflow:hidden it will fit properly and the background image will be correctly aligned; however the content stays in the wrong spot in Firefox and still displays correctly in IE. I have all margins and padding set to 0. Any help would be greatly appreciated.

jcdevelopment
05-13-2008, 07:10 PM
have you tried


* {
margin:0px;
padding:0px;
}

if so it may be the positioning thats causing it!

el_muerte2
05-13-2008, 07:32 PM
Wow that fixed it! Thanks. Why would using
* { work but not the same thing in
html, body {

jcdevelopment
05-13-2008, 07:46 PM
*

in CSS that is everything. Meaning whatever properies you add it will edd it to every element on the page including divs.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum