Last active
December 21, 2015 16:59
-
-
Save mjj2000/6337698 to your computer and use it in GitHub Desktop.
Round avatar with CSS3
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
/* Configure by modifying variables: | |
$round-width: size of round avatar | |
$avatar-image: image path of ravatar | |
*/ | |
div.round-avatar{ | |
$round-border-size: 5px; | |
$round-border-color: #fff; | |
$round-width: 100px; | |
$round-height: $round-width; | |
$avatar-image: url('//goo.gl/Nw9pE2'); | |
margin: 0 auto; | |
width: $round-width; | |
height: $round-height; | |
position: relative; | |
border-radius: 50%; | |
background: $round-border-color; | |
&:before { | |
content: ''; | |
border-radius: 50%; | |
position: absolute; | |
width: $round-width - ($round-border-size * 2); | |
height: $round-height - ($round-border-size * 2); | |
top: $round-border-size; | |
left: $round-border-size; | |
background: $avatar-image no-repeat center; | |
background-size: 100%; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment