Mauricio Samy Silva wrote:

> This is a collapsing margin issue.

It would have been a 'collapsing margin' issue, but in this case...

>> http://tinyurl.com/2d279b

...the potential margin is _zeroed out_.

The...

>> border: 1px solid yellow; border: none;

...doesn't make any sense since the border is declared on - and
then removed from - the wrong element. There _is_ no border on p.addr,
and having one would not have any effect - regardless of whether the
margin is zero or something else on p.addr itself.

Collapsing margins are confusing enough in themselves, but in this case
it looks like the margins was zeroed just before the fix was added, so
the fix seems to have an effect even if it doesn't.

-----------

The only effect of such an "add fixes until it works" approach, is that
one may lose track of which fix actually worked and which didn't.
Lots of half-tested "fixes" around on the web...

It is important to go all the way back by removing fixes until the
problem appears again, and then add and keep only one "fix" at a time
until the problem and which fix to use us sorted out.
Repeat a few dozen times for each problem - until one is sure the
problem is understood and one is using a good fix for it, and then make
notes for the next time the same or similar problems occur. A good set
of notes will save hours and days of frustration and head scratching in
future projects.

-----------

*Containing collapsing margins* - one way or another...

If elements inside a container have vertical margins that should be
contained, then it's the _container_, #footer or #footercontent in this
case, that shall have a "contain all margins" declaration.

IE/win already got a "contain all margins" declaration - 'height: 760px'
on #footer, although that's of course just one of the "against all
standards" effect a 'hasLayout'[1] trigger always has.

More standard compliant browsers do need an actual border-top or an
actual padding-top - alternatively a declaration causing the
establishment of a new 'block formatting context'[2] on the container -
on #footer or #footercontent in this case.
Even a 'clearing' element between the element with the
problematic margins and the edge of the container itself, will do.

-----------

Of course: the simplest way to solve 'collapsing margins' problems is to
zero out all potentially problematic margins - as was done in the
original case in this thread. Some actually promote such an approach.

I'd call that a pretty limited or limiting "solution", since having *no*
margins means I've lost a vital ingredient, and adding *new* margins
will cause any problematic 'collapsing margins' to pop up again.
I don't like to design within such limitations, so I prefer to be in
control of the problem itself - whenever it occurs.

regards
        Georg

[1]http://www.satzansatz.de/cssd/onhavinglayout.html
[2]http://www.w3.org/TR/CSS21/visuren.html#q15
-- 
http://www.gunlaug.no
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- 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