html做下拉菜单栏
状态效果如下:
代码如下:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<style>
.one{
width:200px;
}
.two{
width:200px;
height:50px;
background-color:blue;
text-align:center;
line-height:50px;
color: aqua;
}
.three{
width:200px;
height:300px;
background-color:green;
display:none;
}
ul{
list-style:none;
margin-left:-40px;
}
ul li{
line-height:50px;
display:block;
width:200px;
text-align:center;
}
.one:hover{
cursor: pointer;
}
.one:hover .three{
display: block;
}
.one:hover .two{
background-color: bisque;
}
li:hover{
background-color: cadetblue;
color: aquamarine;
}
</style>
</head>
<body>
<div class="one">
<div class="two">下拉菜单</div>
<div class="three">
<ul>
<li>列表项1</li>
<li>列表项2</li>
<li>列表项3</li>
<li>列表项4</li>
</ul>
</div>
</div>
</body>
</html>