View Single Post
  #9 (permalink)  
Old March 31st, 2005, 11:46 AM
czambran czambran is offline
Friend of Wrox
 
Join Date: Jun 2004
Location: Fairfield, Iowa, USA.
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Like if I didn't have enough things to worry about, this margin collapse has my head spinning, specially when it involves a floating element.

On page 317, the second paragraph is flushed against the top of the div element that contains the two paragraphs, you explained the reason for this is because the default top of the the margin of the normal paragraph has collapsed and yielded to the top margin of the <div> element. But why is it flushed against the div instead of flushed against the first paragraph, its like the first paragraph ins't part of the flow. could u please explain why?

On you post before last u told me to disregard an explanation you gave on 3 posts before last,
Quote:
quote:If <p> is 100% of the width of the <body> element, then the width of the <p> element is calculated as follows:

width of <body> + <p> margin + <p> padding + <p> border

This is why you see scrollbars in Firefox. In Firefox it's:
width of <body> + 20px margin (left and right) + 20px padding + 2px border = greater than the width of the body.
which made sense or where u referring to the second explanation(the reason behind no right margin). The reason u have to why the p elements overflows the body element made sense but The body element hasn't been given an specific width so shouldnt it expand to accomodate the block element it contains(a p element on this case)?

Thanks for your immense patience


Christian