I have the following code:
.parent {
width: 30%;
border: 1px dotted red;
}
.child {
padding-top: 100%;
border: 1px solid black;
}
<div class="parent">
<div class="child"></div>
</div>
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?
What does padding-top: 100%
do?