Created
December 20, 2011 09:20
-
-
Save maxhoffmann/1500919 to your computer and use it in GitHub Desktop.
CSS3 Border-Radius with Border - Circle Avatars
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
/** | |
* CSS3 Border-Radius with Border - Circle Avatars | |
*/ | |
/* General Styles */ | |
body { text-align: center; | |
background: url(http://subtlepatterns.com/patterns/white_texture.png); | |
min-height: 100%; font: 100 14px sans-serif; | |
color: #444555; text-shadow: 0 2px white; | |
} | |
::-moz-selection { background: rgba(0,0,0,0.1); } | |
::selection { background: rgba(0,0,0,0.1); } | |
h1 { font-weight: 100; font-size: 2.7em; } | |
h3 { color: #555666; font-size: 1.6em; } | |
a { color: RoyalBlue; font-weight: normal; text-decoration: none; } | |
a:hover { color: CornflowerBlue; } | |
ul { width: 250px; margin: 0 auto; text-align: left; line-height: 1.8; } | |
/* Avatar Styles */ | |
.circle { | |
line-height: 0; | |
display: inline-block; | |
margin: 5px; | |
padding: 3px; | |
border-radius: 50%; | |
background: white; | |
box-shadow: 0px 0px 5px rgba(0,0,0,0.4); | |
transition: linear 0.25s; | |
} | |
.circle img { | |
border-radius: 50%; | |
} | |
.circle:hover { | |
transition: ease-out 0.3s; | |
transform: scale(0.8) rotate(20deg); | |
cursor: pointer; | |
} | |
a.circle { color: transparent; } /* IE fix: removes blue border */ |
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
<h1>CSS3 Border-Radius with Border</h1> | |
<p>Square image can be any size. Crossbrowser support. Futureproof.</p> | |
<h3>Small Avatars</h3> | |
<a href="http://twitter.com/dabblet" class="circle"> | |
<img src="http://twitter.com/api/users/profile_image?screen_name=dabblet" alt="dabblet"> | |
</a> | |
<a href="http://twitter.com/leaverou" class="circle"> | |
<img src="http://twitter.com/api/users/profile_image?screen_name=leaverou" alt="Lea Verou"> | |
</a> | |
<a href="http://twitter.com/paul_irish" class="circle"> | |
<img src="http://twitter.com/api/users/profile_image?screen_name=paul_irish" alt="Paul Irish"> | |
</a> | |
<a href="http://twitter.com/chriscoyier" class="circle"> | |
<img src="http://twitter.com/api/users/profile_image?screen_name=chriscoyier" alt="Chris Coyier"> | |
</a> | |
<a href="http://twitter.com/max_hoffmann" class="circle"> | |
<img src="http://twitter.com/api/users/profile_image?screen_name=max_hoffmann" alt="Maximilian Hoffmann"> | |
</a> | |
<h3>Big Avatar</h3> | |
<a href="http://twitter.com/max_hoffmann" class="circle"> | |
<img src="http://behance.vo.llnwd.net/profiles9/545710/5a1ba5c679a44708c9b068d14cd1e7c8.jpg" alt="avatar"> | |
</a> | |
<h4>Tested and works on:</h4> | |
<ul> | |
<li>Chrome 16</li> | |
<li>Safari 5.1</li> | |
<li>Firefox 7+</li> | |
<li>IE9 (no transition)</li> | |
</ul> | |
<p>Found a bug? Send me a tweet: <a href="http://twitter.com/max_hoffmann" title="switch to twitter">@max_hoffmann</a></p> |
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
{"view":"split-vertical","prefixfree":"1","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment