sepoto Posted August 11, 2013 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... Link to comment Share on other sites More sharing options...
dsonesuk Posted August 11, 2013 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now