Created
May 10, 2018 23:45
-
-
Save ihpannu/e06bad85001e80db5d6ad136ca9fc969 to your computer and use it in GitHub Desktop.
CSS MAGIC
This file contains 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
/* Responsive Circle */ | |
/* make sure your padding top is the same as your width and make your height auto. */ | |
.circle { | |
position: relative; | |
border-radius: 50%; | |
width: 100%; | |
height: auto; | |
padding-top: 100%; | |
background: white; | |
} | |
/* Responsive Square */ | |
.square { | |
position: relative; | |
width: 50%; | |
} | |
.square:after { | |
content: ""; | |
display: block; | |
padding-bottom: 100%; | |
} | |
.content { | |
position: absolute; | |
width: 100%; | |
height: 100%; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment