<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<style>
body{
perspective: 500px;
}
.box{
position: relative;
width: 300px;
height: 300px;
margin: 100px auto;
transform-style: preserve-3d;
transition: all .4s;
}
.front,.back{
position: absolute;
top:0;
left:0;
width: 100%;
height: 100%;
border-radius: 50%;
background-color: red;
font-size: 30px;
color:#fff;
text-align: center;
line-height: 300px;
}
.front{
z-index: 1;
}
.back{
background-color: antiquewhite;
/* 使两个盒子背靠背 */
transform: rotateY(180deg);
}
.box:hover{
transform: rotateY(180deg);
}
</style>
</head>
<body>
<div class="box">
<div class="front">正面</div>
<div class="back">反面</div>
</div>
</body>
</html>