Skip to content

Instantly share code, notes, and snippets.

@gustaff-weldon
Last active April 25, 2017 12:22
Show Gist options
  • Save gustaff-weldon/41f95a02881a643c24d7e519cb80559b to your computer and use it in GitHub Desktop.
Save gustaff-weldon/41f95a02881a643c24d7e519cb80559b to your computer and use it in GitHub Desktop.
Untitled
.circle-container {
width: 20%;
}
.circle {
/* circle code start */
border-radius: 50%;
width: 100%;
height: auto;
padding-top: 100%;
/* needed for content positioning */
position: relative;
/* here we want border but can use background if needed */
border: 5px solid red;
}
.circle__content {
/* v/h centered */
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
}
<!-- responsive circle -->
<div class="circle-container">
<div class="circle">
<div class="circle__content">
<span>1 of 2</span><br/><span>used</span>
</div>
</div>
</div>
// alert('Hello world!');
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment