|
Prev: Firefox doesn't handle float:right in UL correctly
Next: IE 7 -- extraneous bottom scrollbar....
From: André Hänsel on 7 Apr 2008 20:21 Hi, when I have two nested divs, the inner one with a margin-bottom and the outer one with a padding-bottom, the margin of the inner div is ignored when I set the padding of the outer div to 0. Look at this example: http://kundenweb.creations.de/usenet/css/powerfulpadding.htm Since this is valid in IE and Firefox it's probably the desired behaviour, but where is it defined in the spec? Regards, André
From: dorayme on 7 Apr 2008 23:12 In article <49144485-582d-49ad-9763-f9966b1aec16(a)b9g2000prh.googlegroups.com>, Andr� H�nsel <andre(a)webkr.de> wrote: > Hi, > > when I have two nested divs, the inner one with a margin-bottom and > the outer one with a padding-bottom, the margin of the inner div is > ignored when I set the padding of the outer div to 0. > > Look at this example: > http://kundenweb.creations.de/usenet/css/powerfulpadding.htm > > Since this is valid in IE and Firefox it's probably the desired > behaviour, but where is it defined in the spec? You might also notice that a border on the containing div also triggers the margin to show on the contained element -- dorayme
From: dorayme on 7 Apr 2008 23:51 In article <doraymeRidThis-FB1177.13125808042008(a)news-vip.optusnet.com.au>, dorayme <doraymeRidThis(a)optusnet.com.au> wrote: > In article > <49144485-582d-49ad-9763-f9966b1aec16(a)b9g2000prh.googlegroups.com>, > Andr� H�nsel <andre(a)webkr.de> wrote: > > > Hi, > > > > when I have two nested divs, the inner one with a margin-bottom and > > the outer one with a padding-bottom, the margin of the inner div is > > ignored when I set the padding of the outer div to 0. > > > > Look at this example: > > http://kundenweb.creations.de/usenet/css/powerfulpadding.htm > > > > Since this is valid in IE and Firefox it's probably the desired > > behaviour, but where is it defined in the spec? > > You might also notice that a border on the containing div also triggers > the margin to show on the contained element I assume you have looked at the CSS 8.3.1 and associated sections. Perhaps a read of this might help you: <http://complexspiral.com/publications/uncollapsing-margins/> -- dorayme
|
Pages: 1 Prev: Firefox doesn't handle float:right in UL correctly Next: IE 7 -- extraneous bottom scrollbar.... |