Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Absolute Pos works w/ Border, breaks without Re: Absolute Pos works w/ Border, breaks without

#122327
wolfcry911
Participant

@TBurke,
I can answer your question. Your basic markup was like this: #outercontainer, then two child divs that were taken out of the document flow because they were position: absolute. The next element was the #pagecontainer which has a top margin of 117px. This top margin extends outside of its parent (#outercontainer) unless one of couple things happen. The first two are either a top padding, or top border on the parent – you had placed a top border to temporarily outline elements. The other way is to change the block formatting context of the parent. Any of these changes will force the element’s top margin to begin at the top of the parent instead of extending outside. So, how do you change the BFC of the element? Simple – add overflow: hidden; to #outercontainer

Now, that you know the why, I have to agree with Paulie, I don’t think I would have used absolute positioning here. I’m not as reserved as Paulie with regards to AP, but I would have gone with floats here.