How does padding-top: 100% work?
<p>I have the following code:</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-css lang-css prettyprint-override"><code>    .parent {
      width: 30%;
      border: 1px dotted red;
    }

    .child {
      padding-top: 100%;
      border: 1px solid black;
    }</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code> &lt;div class="parent"&gt;
      &lt;div class="child"&gt;&lt;/div&gt;
    &lt;/div&gt;</code></pre>
</div>
</div>
</p>

<p>And for some reason the child becomes a perfect square. This is at least weird because none of the divs have any height assigned to them. Why is this happening?</p>

<p>What does <code>padding-top: 100%</code> do?</p>

<p><a href="https://jsfiddle.net/d9nu3hqb/1/" rel="noreferrer">Fiddle</a></p>