Newbie question alert, please take a look at this example: http://codepen.io/cguo/pen/mVNgvG
The h1
element's margin-top
is 60px. Even though the h1
element is inside the container
div, the margin-top
is not set relative to the container
but to the top of the page.
To achieve what I want, I have to change h1
's margin-top
to padding-top
.
Why isn't margins set relative to their parents? Is this the standard behavior of margin?