1 reply [Last post]
duckxtales
Offline
Regular
Last seen: 4 years 44 weeks ago
Timezone: GMT-5
Joined: 2007-05-15
Posts: 27
Points: 0

hi,

always had this problem but didnt really know how to fix it or what it was called. So i am coding for FF3. There are 2 Div blocks.

The first div box has:

width:100px;
height:100px;
margin:10px 0px;

the second div box:

width:100px;
height:100px;
margin:5px 0px;

So in between these boxes it should have a 15px gap, but it does not. it only has a 5px gap. the first div block's bottom-margin is not being recognized. Why? The solution I've always used it, just float the bottom block to make it recognize the 1st div block's bottom margin. Anyone have a better solution without floating these blocks or using padding?

thanks

wolfcry911
wolfcry911's picture
Offline
Guru
MA, USA
Last seen: 6 years 40 weeks ago
MA, USA
Timezone: GMT-5
Joined: 2004-09-01
Posts: 3224
Points: 237

There should not be a 15px

There should not be a 15px gap per specs. There should be a 10px gap. Read up on margin collapse. If you do indeed only have a 5px margin between the two, then something is wrong...

as for the question, if you want 15px between the two, why not set one of the margins (bottom of first, or top of second) to 15px?