I have a div
(parent) that contains another div
(child). Parent is the first element in body
with no particular CSS style. When I set
.child
{
margin-top: 10px;
}
The end result is that top of my child is still aligned with parent. Instead of child being shifted for 10px downwards, my parent moves 10px down.
My DOCTYPE
is set to XHTML Transitional
.
What am I missing here?
edit 1
My parent needs to have strictly defined dimensions because it has a background that has to be displayed under it from top to bottom (pixel perfect). So setting vertical margins on it is a no go.
edit 2
This behaviour is the same on FF, IE as well as CR.