<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
*{
margin: 0;
padding: 0;
}
ul{
width: 800px;
height: 50px;
margin: 100px auto;
}
li{
float: left;
margin-right: 10px;
list-style: none;
width: 120px;
height: 50px;
perspective: 800px;
}
li:hover a{
transform: rotateX(-90deg);
}
a{
display: block;
width: 120px;
height: 50px;
text-decoration: none;
transform-style: preserve-3d;
position: relative;
transition: all 1s;
}
a span{
display: block;
width: 120px;
height: 50px;
line-height: 50px;
text-align: center;
color: #fff;
position: absolute;
top: 0;
left: 0;
}
a span:first-child{
background-color: orange;
transform: translateY(-25px) rotateX(90deg);
}
a span:last-child{
transform: translateZ(25px) ;
background-color: green;
}
</style>
</head>
<body>
<ul>
<li>
<a href="#">
<span>index</span>
<span>首页</span>
</a>
</li>
<li>
<a href="#">
<span>index</span>
<span>首页</span>
</a>
</li>
<li>
<a href="#">
<span>index</span>
<span>首页</span>
</a>
</li>
</ul>
</body>
</html>
01-29
184