Jump to content

Upper Margin for nested Div's


sepoto

Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...