How is the margin-top percentage calculated?
<p>I know this should be straightforward, but can anybody tell me why the child boxes in the following overflow their parent's container when a <code>margin-top: 50%</code> is applied to the child. How is the margin-top percentage calculated?</p>

<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-css lang-css prettyprint-override"><code>.container {  
  background: lightblue; 
  padding: 10px; 
  height: 200px;
}

p { 
  display: block; 
  border:1px solid red;
  margin-top:50%;
}</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="container"&gt;
&lt;p&gt; Some Cool content&lt;/p&gt;
 
&lt;/div&gt;</code></pre>
</div>
</div>
</p>

<p>Shouldn't the child element be placed 50% from 200px (set height on parent), i.e 100px from top?</p>