HighDots Forums  

Gap between divs in FF

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


Discuss Gap between divs in FF in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Andy
 
Posts: n/a

Default Gap between divs in FF - 10-13-2005 , 07:17 AM






hello all,

Having moved to trying table-free layout, I'm struggling a bit with
divs and spacing.

I've got two divs, the first of which solely contains an image, then a
second div below which contains only text. I'd like there to be zero
gap between the two.

I've succeeded in doing this in IE(6.08) but the only way I can get
the same result in Firefox(1.0.7) is to explicitly give the first div
a height of 159px - which is 16px smaller than the image the div
contains.

file is here: http://www.industrialandmarine.com/nl.html

Why does Firefox display this 16px gap?

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

Default Re: Gap between divs in FF - 10-13-2005 , 07:51 AM






Andy <g@g.com> wrote:
Quote:
Having moved to trying table-free layout, I'm struggling a bit with
divs and spacing.

I've got two divs, the first of which solely contains an image, then a
second div below which contains only text. I'd like there to be zero
gap between the two.

I've succeeded in doing this in IE(6.08) but the only way I can get
the same result in Firefox(1.0.7) is to explicitly give the first div
a height of 159px - which is 16px smaller than the image the div
contains.

file is here: http://www.industrialandmarine.com/nl.html

Why does Firefox display this 16px gap?
Collapsing margins:
http://www.w3.org/TR/CSS21/box.html#collapsing-margins

The top margin of the first paragraph collapses with the div above
because there's nothing in between the two. The second div doesn't
affect this because it has no top padding and/or border.

--
Spartanicus


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

Default Re: Gap between divs in FF - 10-13-2005 , 07:57 AM



On Thu, 13 Oct 2005 11:51:33 GMT, Spartanicus
<invalid (AT) invalid (DOT) invalid> wrote:

Quote:
Andy <g@g.com> wrote:
[snip]

Quote:
Collapsing margins:
http://www.w3.org/TR/CSS21/box.html#collapsing-margins

The top margin of the first paragraph collapses with the div above
because there's nothing in between the two. The second div doesn't
affect this because it has no top padding and/or border.
ahaaa

yes, I though it was something to do with that, but the fact it was
the p margin and not the div margin eluded me...

thanks!


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 - 2009, Jelsoft Enterprises Ltd.