双面翻转3D效果

<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>双面翻转3D效果</title>
<style>
* {
margin: 0;
padding: 0;
}
.box {
width: 550px;
height: 550px;
transform-style: preserve-3d;
margin: 100px auto;
position: relative;
animation: play 5s linear infinite;
}
.box div {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
font-size: 50px;
line-height: 300px;
font-weight: 700;
text-align: center;
border-radius: 50%;
}
.behind {
background: url(1.jpg) no-repeat center;
background-size: cover;
transform: rotateY(180deg);
}
.front {
background: url(1.jpg) no-repeat center;
background-size: cover;
}
@keyframes play {
0% {
transform: rotateY(0deg);
}
100% {
transform: rotateY(360deg);
}
}
</style>
</head>

<body>
<div class="box">
<div class="behind"></div>
<div class="front"></div>
</div>
</body>

</html>

猜你喜欢

转载自blog.csdn.net/leeningfeng/article/details/79408202