We would like to know how to create a fancy avatar with CSS3 Box-shadow.
<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.avatar {<!-- ww w. ja v a 2 s. c o m-->
width: 120px;
height: 120px;
margin: .5em;
display: inline-block;
background-repeat: none;
background-size: 100% 100%;
border-radius: 8px;
-webkit-box-shadow: inset -1px -1px 8px #000, inset 2px 3px 1px #fff;
box-shadow: inset -1px -1px 8px #000, inset 2px 3px 1px #fff;
}
</style>
</head>
<body>
<div class="avatar" style="background-image: url()"></div>
<div class="avatar"
style="background-image: url(http://www.java2s.com/style/download.png)"></div>
<div class="avatar"
style="background-image: url()"></div>
</body>
</html>
The code above is rendered as follows: