Gustaf Liljegren wrote:[color=blue]
> I dare not start a new thread now, but I seem to have encountered yet
> another padding "problem" in Firefox. My page:
>
>
http://gusgus.cn/test/
>
> Here's the CSS that won't work:
>
> #left {
> float: left;
> width: 390px;
> overflow: hidden;
> background-color: #DDFFDD; /* green */
> text-align: justify;
> padding: 10px 10px 10px 0px;
> border-right: 5px solid black;
> }
>
> When the let column is rendered in Firefox, its right padding is 20
> pixels, not 10. No matter what value I put there, Firefox doubles it! Is
> there a reason for this too?
>
> Gustaf[/color]
Since you float left, #left, it is taken out of the normal flow. Padding
(or margin) will affect the box itself which you don't want. The
solution, and proper method, is to remove the padding from #left and to
instead apply margin to its content as in:
#left {
float: left;
width: 390px;
overflow: hidden;
background-color: #DDFFDD; /* green */
text-align: justify;
/* padding: 10px 10px 10px 0px; */
border-right: 5px solid black;
}
#left p { margin: 10px 10px 10px 0; }
The reason I use margin instead of padding, is that padding would give
you extra spacing between paragraphs, whereas margin is collapsed.
--
Gus