SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    RTFM ashleyk's Avatar
    Join Date
    Dec 2005
    Location
    Rochester, New York
    Posts
    435
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    collapsing margin, why? firefox

    http://www.mglomb.com/clients/GLK/we...ncollapse.html

    I have read Andy Budd's great article explaining collapsing margins, which is quite helpful. The 1px padding does solve the problem, but i don't understand why, perhaps someone could enlighten me?

    If you look at the html and css in the above link, you will see that there's a "menu" div butted up against a "content" div. Inside the "content" div there's a "breadcrumbs" div. the "content" div has a BG image repeating. in firefox the "content" div creates a gap between itself and the "menu" div, not correct.

    All margins are set to 0 using *. When i apply a 5px top-margin to the "breadcrumbs" div (residing inside "content"), the margin doesn't push down the "breadcrumbs" div from "content", instead it pushes the "content" div away from the "menu" div.

    it seems to be some sort of collasping margin issue, i suppose since the "content" div has a top margin of 0, it is collapsing with the 5 px of margin from the "breadcrumbs" div, and taking the 5px of margin for itself. is that a correct assumption?

    i can use the 1px padding workaround, but was there some other way of fixing this?
    ---------------------------------------
    Ashley Kennedy
    ---------------------------------------
    how does a designer get roped into writing code?

  2. #2
    RTFM ashleyk's Avatar
    Join Date
    Dec 2005
    Location
    Rochester, New York
    Posts
    435
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    thanks!

    also a good solution. Kind of better, because it will be easier to to keep track of spacing in one location rather than two.
    thanks!

    so does that margin really "reverse collapse" and turn 0px into 5px?
    ---------------------------------------
    Ashley Kennedy
    ---------------------------------------
    how does a designer get roped into writing code?


Bookmarks

Posting Permissions

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