In article Brian wrote:[color=blue]
> Lauri Raittila wrote:[color=green]
> > In article Brian wrote:
> >[color=darkred]
> >> on the long page
http://www.tsmchughs.com/test/long there is an
> >> unwanted space of what looks like 1em between the content and
> >> footer divs. Reproducible on Mozilla 1.3, O7.23, and MSIE
> >> 5.01/Windows2k.[/color]
> >
> > I see this space in both examples. It sounded like margin
> > collapsing, and it was margin collapsing.[/color]
>
> I didn't -- still don't, really -- know much about margin collapsing.
> When I have time, I'll have to read up on it. I suppose it means that
> a bottom margin on e.g. the last paragraph will become the
> bottom-margin of a div with bottom-margin: 0. Not what I expected.
>[color=green]
> > Solutions:
> > - add some padding-bottom or border-bottom to content div.[/color]
>
> Works in Moz/Opera. Does not work in MSIE 5.01/Win.[/color]
I have no IE5.01, so I can't help. I past, I have used padding in P
instead of margin when making solid border around page. (I didn't wan't
to use wrapper div, as whole point of that example was not to need
wrapper div...)
The problem with using padding is that you luse advantages of margin
collapsing...
[color=blue][color=green]
> > remove margin form last P[/color][/color]
[color=blue]
> I hate to have to add all that style info to my css. I'll need it for
> lots of pages. I guess I'll have to decide how imporant this is.[/color]
Too bad CSS3 is not supported...
[color=blue][color=green]
> > How to find what causes unwanted whitespace:
> > 1. check if margins are collapsing
> > 2. check whitespce in wrong places.[/color]
>
> Thanks a bunch. I would not have figured this out without some help.[/color]
Tests:
1. * {margin:0;} or * {border:thin solid} -> whitespace goes away
-> it's margin collapsing
2. s/(\n|(>) | (<))/$2/g -> white space goes away -> it's white space bug
or something similar.
(I hope I did that correctly, I can't contact my unix shell to test at
moment)
Of course, neither is solution, but way to find out which one is the
problem, if either.
--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Saapi lähettää meiliä, jos aihe ei liity ryhmään, tai on yksityinen
tjsp., mutta älä lähetä samaa viestiä meilitse ja ryhmään.