效果图:
完整代码:
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>下拉菜单</title>
<style type="text/css">
*{
margin:0px;
padding:0px;
}
#nav{
width:100%;
height:40px;
background-color:rgb(30,84,164);
}
ul{
list-style-type:none;
}
li{
}
a{
text-decoration:none;
font-size:14px;
color:white;
}
#menu{
width:1100px;
height:40px;
margin:0 auto;
}
#menu>li{
width:90px;
height:40px;
line-height:40px;
float:left;
position:relative;
}
#menu>li>a{
display:block;
text-align:center;
width:100px;
height:40px;
}
.banner{
width:1000px;
height:245px;
margin:0 auto;
background-color:skyblue;
}
a:hover{
color:yellow;
}
.submenu{
width:100px;
position:absolute;
text-align:center;
background-color:skyblue;
display:none;
}
.submenu li{
border-bottom:1px dashed white;
}
#menu>li:hover .submenu{
display:block;
}
</style>
</head>
<body>
<div > -->
</div>
</body>