Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    May 2008
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    firefox nested div problem

    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
    Code:
    #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.

  • #2
    Senior Coder jcdevelopment's Avatar
    Join Date
    Oct 2007
    Location
    Cowboy Nation
    Posts
    2,182
    Thanks
    174
    Thanked 257 Times in 257 Posts
    have you tried

    Code:
    * {
    margin:0px;
    padding:0px;
    }
    if so it may be the positioning thats causing it!

  • #3
    New to the CF scene
    Join Date
    May 2008
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Wow that fixed it! Thanks. Why would using
    Code:
    * {
    work but not the same thing in
    Code:
    html, body {

  • #4
    Senior Coder jcdevelopment's Avatar
    Join Date
    Oct 2007
    Location
    Cowboy Nation
    Posts
    2,182
    Thanks
    174
    Thanked 257 Times in 257 Posts
    Code:
    *
    in CSS that is everything. Meaning whatever properies you add it will edd it to every element on the page including divs.

  • Users who have thanked jcdevelopment for this post:

    el_muerte2 (05-13-2008)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •