Jump to content

Upper Margin for nested Div's


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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...