Created
March 12, 2016 17:24
-
-
Save andreypelykh/83b7c86f1896478f5e5c to your computer and use it in GitHub Desktop.
css padding hack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.wrapper { | |
width: 100px; | |
margin: 0 auto; | |
} | |
.box { | |
background: goldenrod; | |
margin-left: auto; | |
margin-right: auto; | |
padding-top: 50%; | |
padding-bottom: 50%; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment