<div class="box">
<div class="front">你好</div>
<div class="back">打工人</div>
</div>
body {
transform-style: preserve-3d;
perspective: 500px;
}
.box {
position: relative;
width: 200px;
height: 200px;
margin: 100px auto;
transition: all 0.5s;
transform-style: preserve-3d;
}
.box:hover {
transform: rotateY(180deg);
}
.front,
.back {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border-radius: 50%;
text-align: center;
line-height: 200px;
color: #fff;
font-size: 50px;
}
.front {
background-color: red;
z-index: 1;
}
.back {
background-color: pink;
transform: rotateY(180deg);
}
浏览器调试后不能实现鼠标经过的时候,打工人字样出现,请求懂的人帮忙看看