现场演示 – 下载源代码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | <!doctype html> <html lang="en-US"> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> <title>Custom CSS3 Avatars - Demo #1</title> <meta name="author" content="Jake Rocheleau"> <link rel="shortcut icon" href="https://www.vandelaydesign.com/favicon.ico"> <link rel="icon" href="https://www.vandelaydesign.com/favicon.ico"> <link rel="stylesheet" type="text/css" media="all" href="styles.css"> <link rel="stylesheet" type="text/css" media="all" href="http://fonts.googleapis.com/css?family=Cantora+One"> <!--[if lt IE 9]> <script type="text/javascript" src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> </head> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | <div id="leftcol"> <div class="avatar-container"> <!-- Avatar Source: http://vimeofaces.tumblr.com/post/932459489 --> <img src="images/avatar.jpg" alt="Default avatar" title="User Avatar" width="250" height="250" class="ava1"> </div> <h2 class="username">Johnny Appleseed</h2> <h3 class="location">Boston, MA</h3> <div class="divider"> </div> <p class="desc">Frontend web developer and startup enthusiast. I would say that I like Apple products but nobody really cares anyways.</p> </div><!-- @end #leftcol --> <div id="rightcol"> <nav class="profiletabs"> <ul class="clearfix"> <li><a href="index.html" class="sel">Demo #1</a></li> <li><a href="index1.html">Demo #2</a></li> <li><a href="index2.html">Demo #3</a></li> <li><a href="index3.html">Demo #4</a></li> <li><a href="index4.html">Demo #5</a></li> </ul> </nav> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | .avatar-container { display: block; margin-bottom: 7px; } /** avatar #1 **/ .ava1 { border: 1px solid #cbcbcb; padding: 7px; background: #fff; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: -2px 2px 6px -1px rgba(0,0,0,0.3); -moz-box-shadow: -2px 2px 6px -1px rgba(0,0,0,0.3); -o-box-shadow: -2px 2px 6px -1px rgba(0,0,0,0.3); box-shadow: -2px 2px 6px -1px rgba(0,0,0,0.3); } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | /** avatar #2 **/ .ava2 { display: block; -webkit-border-radius: 100%; -moz-border-radius: 100%; border-radius: 100%; width: 250px; height: 250px; background: #fff; -webkit-box-shadow: -1px 3px 3px rgba(0,0,0,0.3); -moz-box-shadow: -1px 3px 3px rgba(0,0,0,0.3); box-shadow: -1px 3px 3px rgba(0,0,0,0.3); } /** avatar #3 **/ .ava3 { border-radius: 14px; -webkit-box-shadow: 0 2px 1px rgba(0,0,0,0.4); -moz-box-shadow: 0 2px 1px rgba(0,0,0,0.4); box-shadow: 0 2px 1px rgba(0,0,0,0.4); } /** avatar #4 **/ .ava4 { display: block; padding: 7px; background: #eaf0f3; border: 2px dashed #bbb; -webkit-border-radius: 3px; -moz-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | /** avatar #5 **/ /** default styles courtesy of Dan Eden http://jsfiddle.net/FwF32/19/ */ .a5container { border-radius: 4px; display: inline-block; position: relative; -webkit-box-reflect: below 5px -webkit-linear-gradient(transparent 70%, rgba(0,0,0,0.3) 90%); } .a5container .ava5 { display: block; box-shadow: 0 0 2px 1px rgba(0,0,0,.2); border-radius: 4px; } .a5container:after { content: ''; z-index: 999; display: block; position: absolute; background: -webkit-linear-gradient(rgba(255,255,255,0.4),transparent 70%); background: -moz-linear-gradient(rgba(255,255,255,0.4),transparent 70%); background: -ms-linear-gradient(rgba(255,255,255,0.4),transparent 70%); background: -o-linear-gradient(rgba(255,255,255,0.4),transparent 70%); background: linear-gradient(rgba(255,255,255,0.4),transparent 70%); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.3), 0 0 0 1px rgba(0,0,0,0.2); border-radius: 4px; top: 1px; left: 1px; bottom: 1px; right: 1px; } |