css头像翻转实例

来源:互联网 发布:手机钢琴软件哪个好 编辑:程序博客网 时间:2024/06/06 08:44
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<style type="text/css">
*{
margin: 0;
padding: 0;
}
.box{
width: 200px;
height: 200px;
border-radius: 50%;
margin: 100px auto;
position: relative;
}
.box div{
width: 100%;
height: 100%;
left: 0;
top: 0;
position: absolute;
background: url(img/1463364415735.jpg) no-repeat center 0;
background-size: cover;
border-radius: 50%;
transition: .5s;

}
.box div:nth-child(2){
transform-origin: bottom;
background-image: url(img/20150907161026_xNyKj.jpeg);
}

.box:hover div:nth-child(2){
transform: rotateX(180deg);
}
.box:hover div:nth-child(1){
transform: rotate(360deg);
}
</style>
<body>
<div class="box">
<div></div>
<div></div>
</div>
</body>
</html>
0 0
原创粉丝点击