Sent by Alan Gutierrez on 9 April 2008 17:05
On Apr 8, 2008, at 9:43 PM, Gunlaug Sørtun wrote:
> Alan Gutierrez wrote:
>
>> http://blogometer.com/repository/css/background-border/index.html
>
> You're running into "collapsing margins"[1], where the default
> vertical
> margins - on the paragraph in your case - is escaping its divs
> (#content
> & #container), ending up creating a gap between the divs (#container &
> #photo).
>
> Vertical paddings on those container-divs will "separate margins" and
> prevent that, so something as simple as...
> div {padding: 1px 0;}
> ...will make it appear alright.
> Many other properties/values that will "contain margins", are
> listed in
> the spec[1]. You can of course also zero out the margins on paragraphs
> and add paddings to them instead - if that suits your design.
>
> regards
> Georg
>
> [1]http://www.w3.org/TR/CSS21/box.html#collapsing-margins
Thank you for this answer. It is the answer I was looking for. I
discovered that specifying padding or specifying a border fixed it.
Eventually, because of the content of the div, I didn't have to add
the padding. The question was really to understand what was going on,
if it was a bug or if it was documented behavior.
Alan
--
Alan Gutierrez | [EMAIL-REMOVED] | http://blogometer.com/ | 504
717 1428
Think New Orleans | http://thinknola.com/
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/