<div class="container">
  <p>The blue element inside the white container has a top margin set. Try changing it to see how it affects the space between the element and its parent's top border.</p>

  <div class="parent">
    <div class="element">
      I have a top margin.
body {
  background-color: #F5F5F5;
  color: #555;
  font-size: 1.1em;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;

.container {
  margin: 40px auto;
  max-width: 700px;

.parent {
  border: 2px solid black;
  background-color: white;
  height: 400px;

.element {
  padding: 20px;
  background-color: #0099cc;
  color: white;
  width: 50%;
  height: 100px;
  margin-top: 50px;