Skip to content

Instantly share code, notes, and snippets.

@agragregra
Created February 17, 2015 10:52
Show Gist options
  • Save agragregra/70f4b423e2180cdb3557 to your computer and use it in GitHub Desktop.
Save agragregra/70f4b423e2180cdb3557 to your computer and use it in GitHub Desktop.
<style>
.square {
display: inline-block;
position: relative;
width: 55%;
}
.square_dummy {
margin-top: 100%;
display: block;
}
.square_element {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
</style>
<div class="square">
<span class="square_dummy"></span>
<span class="square_element">Content</span>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment