温习CSS3backface:visibility:hidden=案例百度钱包

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
body{
background: deepskyblue;
}
.box{
width: 300px;
height: 300px;
margin: 200px auto;
position: relative;
}
.box::after,.box::before{
content: '';
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
background: #000;
border-radius:50%;
background: url("images/bg.png") no-repeat left top;
transition:all 1s;
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
-ms-backface-visibility: hidden;
backface-visibility: hidden;

}
.box::before{
transform:rotateY(-180deg);
}
.box::after{
/*left: 300px;*/
background: url("images/bg.png") no-repeat right top;
transform: rotateY(0deg);

}
.box:hover::before{
transform: rotateY(0deg);
}
.box:hover::after{
transform: rotateY(-180deg);
}
</style>
</head>
<body>
<div class="box">

</div>
</body>
</html>

 

发表评论

邮箱地址不会被公开。 必填项已用*标注