Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Two divs 'ignoring' each others margins
Old 07-08-2010, 03:00 PM Two divs 'ignoring' each others margins
pealo86's Avatar
Super Spam Talker

Posts: 876
Name: Matt Pealing
Location: England, north west
Trades: 0
This is a wierd one. I have two divs, #header followed by #page.

#header has a bottom margin or 20px, and #page has a top margin of 20px.

I can see in Firebug that both of the margins are overlapping by about 10px. if I set #header's margin to 0px then the layout does not change at all, but if I change it to 30px the rest of the page shifts down a bit further.

If I change #page's margin to 0px it shifts up by 10 pixels, if I change it to 10px, it's in the same position as if it's set to 0px. If I return it back to 20px then it shifts down by 10 pixels!

I'm viewing this in FF but I think it's happening in all major browsers.

I can't get my head around why this is happening, does anybody have any ideas?

Here is a link to the file:
http://www.freshbeat.co.uk/concept/p...ory-result.htm

Thanks to anyone who can help.
__________________

Please login or register to view this content. Registration is FREE

Last edited by pealo86; 07-08-2010 at 03:02 PM..
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
 
Register now for full access!
Old 07-08-2010, 03:53 PM Re: Two divs 'ignoring' each others margins
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
So, remove the bottom margin on the header or the top margin on #page, you don't really need both.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 07-08-2010, 04:11 PM Re: Two divs 'ignoring' each others margins
pealo86's Avatar
Super Spam Talker

Posts: 876
Name: Matt Pealing
Location: England, north west
Trades: 0
Oh yeah, how did I not think of that! Thanks.

It's been a long day
__________________

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
Reply     « Reply to Two divs 'ignoring' each others margins
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.21319 seconds with 12 queries