HighDots Forums  

Padding of 0px disables margin

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Padding of 0px disables margin in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
André Hänsel
 
Posts: n/a

Default Padding of 0px disables margin - 04-07-2008 , 07:21 PM






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...fulpadding.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é

Reply With Quote
  #2  
Old   
dorayme
 
Posts: n/a

Default Re: Padding of 0px disables margin - 04-07-2008 , 10:12 PM






In article
<49144485-582d-49ad-9763-f9966b1aec16 (AT) b9g2000prh (DOT) googlegroups.com>,
André Hänsel <andre (AT) webkr (DOT) de> wrote:

Quote:
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...fulpadding.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


Reply With Quote
  #3  
Old   
dorayme
 
Posts: n/a

Default Re: Padding of 0px disables margin - 04-07-2008 , 10:51 PM



In article
<doraymeRidThis-FB1177.13125808042008 (AT) news-vip (DOT) optusnet.com.au>,
dorayme <doraymeRidThis (AT) optusnet (DOT) com.au> wrote:

Quote:
In article
49144485-582d-49ad-9763-f9966b1aec16...oglegroups.com>,
André Hänsel <andre (AT) webkr (DOT) 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...fulpadding.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


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.