下拉菜单一般都用ul li来做
先隐藏下拉菜单ul列表,再用hover显示出来
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CSS实现下拉菜单</title>
<style>
.header {width: 960px;height: 40px;background: #616161;margin: 0px auto;}
.header a {
width: 150px;
height: 40px;
text-decoration: none;
font-size: 20px;
line-height: 40px;
background: lightblue;
border-radius: 5px;
margin-right: 10px;
text-align: center;
float: left;
}
.header a:hover {color: #ff6500;}
.header ul {list-style: none;border:1px solid #ccc;display: none;}
.header_down:hover ul {display: block;}
</style>
</head>
<body>
<div class="header">
<a href="">首页</a>
<a href="" class="header_down">产品中心
<ul>
<li>示例产品1</li>
<li>示例产品2</li>
<li>示例产品3</li>
<li>示例产品4</li>
</ul>
</a>
<a href="">技术支持</a>
<a href="">联系我们</a>
</div>
</body>
</html>