Matt Tibbits wrote:
> I have a situation where I have a <div id="content"> that follows a <div
> id="navbar">. FF shows a small space between the 2 "div's", that is until I
> put a border around the <div id="content">. When I do, the div is pulled up
> flush with the top div with only the border in between. 
> [ ... ]
> http://tibbits.ca/test/Camprotary.ca/info.php

You're running into a problem with collapsing margins.  Adjacent 
vertical margins are combined into one, and placed at the top.  When you 
place the border there, the margins are no longer adjacent.  It's the 
margin from the H1 inside div#info whose margin is escaping.  This can 
be somewhat counterintuitive, but seems to be to spec:

     http://www.w3.org/TR/CSS21/box.html#collapsing-margins

You can fix it simply with:

     div#info h1 {margin-top: 0; padding-top: 1em;}

This reduces the offending margin to nothing and then adds back the 
desired space as padding.

Cheers,

   -- Scott Sauyet



______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to