效果图:

一个漂亮的下拉菜单_css

代码:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>高斯下拉菜单</title>
<style>
html{
}
*{
margin: 0;
padding: 0;
}
body{
height: 100%;
display: flex;
justify-content: center;
align-items: center;
background-color: #000000;
}
.list-wrap{
width: 300px;
height: 400px;
text-align: center;
position: relative;

}
li{
list-style: none;
padding: 20px 50px;
color: #fff;
text-align: center;
background-color: #000000;
}
li::before{
content: "";
position: absolute;
top: 0;
left: 0;
z-index: -1;
width: 100%;
height: 100%;
background-color: #ffffff;
transform: scaleY(0);/*标签大小的样式变化*/
transition: transform 0.6s;/*过渡*/
transform-origin: bottom;
filter: blur(40px);
}
li:hover::before{
transform-origin: top;
transform: scaleY(1);//标签大小的样式变化
}
ul li:hover{
background-color: #4CAF50;
transition: transform 0.6s;
}
</style>
<script></script>
</head>
<body>
<ul class="list-wrap">
<!--无序列表标签-->
<li>HTML-CSSHTML</li>
<li>HTML+CSS</li>
<li>HTML+CSS</li>
<li>HTML+CSS</li>
<li>HTML+CSS</li>
<li>HTML+CSS</li>
</ul>
</body>
</html>

欧克,欢迎点赞留言关注????????????!!!