一、代码部分二
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>青枫</title>
<style>
body{
perspective: 400px;
}
.box{
position: relative;
width: 300px;
height: 300px;
margin: 100px auto;
transition: all .4s;
transform-style: preserve-3d;
}
.box:hover{
transform: rotateY(180deg);
}
.front,
.back{
position: absolute;
top: 0;
left: 0;
width:100% ;
height: 100%;
border-radius: 50%;
font-size: 30px;
color: red;
text-align: center;
line-height: 300px;
}
.front{
background-color: pink;
z-index: 1;
}
.back{
background-color: purple;
transform: rotateY(180deg);
}
</style>
</head>
<body>
<div class="box">
<div class="front">青&枫 </div>
<div class="back">欢迎来到青枫网页</div>
</div>
</body>
</html>
二、运行结果
正面
反面