I have a div
(parent) that contains another div
(child). Parent is the first element in body
with no
This is normal behaviour (among browser implementations at least). Margin does not affect the child's position in relation to its parent, unless the parent has padding, in which case most browsers will then add the child's margin to the parent's padding.
To get the behaviour you want, you need:
.child {
margin-top: 0;
}
.parent {
padding-top: 10px;
}