Skip to content

Instantly share code, notes, and snippets.

@selahssea-zz
Created December 2, 2014 17:45
Show Gist options
  • Save selahssea-zz/57f0606ca5144f2a6d08 to your computer and use it in GitHub Desktop.
Save selahssea-zz/57f0606ca5144f2a6d08 to your computer and use it in GitHub Desktop.
Square div pure CSS
.wrapper{
position: relative;
width: 50%;
overflow: hidden;
background: #4679BD;
}
.wrapper:before{
content: "";
display: block;
padding-top: 100%;
}
.inner{
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment