<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
body,html{
padding: 0;
margin: 0;
width: 100%;
height: 100%;
}
ul li{
position: relative;
float: left;
list-style: none;
width: 100px;
height: 50px;
background: #ccc;
margin-left: 50px;
}
ul:after{
content: "";
display: block;
clear: both;
}
li:before{
content: "";
position: absolute;
left: 50%;
top: 100%;
height: 3px;
background: aqua;
width: 0;
transition: all .8s;
}
li:hover:before{
left: 0;
width: 100%;
}
</style>
</head>
<body>
<ul>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</body>
</html>
一个超级简单,但是感觉还好玩的菜单动效