Created
February 6, 2014 11:56
-
-
Save JTLR/8842773 to your computer and use it in GitHub Desktop.
Perfect responsive circle with centered text
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
<time> | |
<div class="spacer"></div> | |
<div class="outer-container"> | |
<div class="inner-container"> | |
<p>22nd</p> | |
<p>September</p> | |
<p>1991</p> | |
</div> | |
</div> | |
</time> |
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
time { | |
display: inline-block; | |
position: relative; | |
width: 50%; | |
.spacer { | |
position: relative; | |
padding-top: 100%; | |
} | |
.outer-container { | |
position: absolute; | |
top: 0; | |
bottom: 0; | |
left: 0; | |
right: 0; | |
background-color: #CCCCCC; | |
@include border-radius(100%); | |
@include box-sizing(border-box); | |
text-align: center; | |
&:before { | |
content: ''; | |
display: inline-block; | |
height: 100%; | |
vertical-align: middle; | |
margin-right: -0.25em; | |
} | |
} | |
.inner-container { | |
display: inline-block; | |
vertical-align: middle; | |
} | |
p { | |
font-family: Arial, Helevetica, sans-serif; | |
font-size: 1em; | |
margin: 0; | |
+ p { | |
font-size: 0.75em; | |
+ p { | |
font-size: 1em; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment