sepoto 1 Posted August 11, 2013 Report Share Posted August 11, 2013 http://jsfiddle.net/sepoto/BrZgj/ <!DOCTYPE html><html><head><title>Page Structure</title><style>#wrapper{width: 1000px;min-height: 75px;background-color: grey;}#inner{margin: 12px auto 0px auto;width: 900px;min-height: 25px;background-color: red;}</style></head><body><div id="wrapper"><div id="inner"></div></div></body></html> I am wondering why adding an upper margin to inner seems to move both the grey and red div's down. I wanted to move down only the red div so that there is some grey still showing at the top of the red div. Thanks in advance... Quote Link to post Share on other sites
dsonesuk 921 Posted August 11, 2013 Report Share Posted August 11, 2013 collapsing margins, the inner margin has a defined margin the outer none, the margin of the inner will seep up from the top edge of outer. one fix is to apply overflow: hidden; to outer. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.