Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ihpannu
Created May 10, 2018 23:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ihpannu/e06bad85001e80db5d6ad136ca9fc969 to your computer and use it in GitHub Desktop.
Save ihpannu/e06bad85001e80db5d6ad136ca9fc969 to your computer and use it in GitHub Desktop.
CSS MAGIC
/* 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