日期:2014-05-17  浏览次数:20827 次

CSS实现纵向二级菜单
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
ul li{ list-style:none}
div ul li{ background:#999999; height:30px; line-height:30px; width:100px; cursor:pointer;}
div ul li:hover .second{ visibility:visible;}
div ul li:hover{ background:#99FF00}
div{ position:relative;}
.second{ position:absolute; top:0px; left:100px; visibility:hidden}
</style>
</head>
<body>
<div>
<ul>
<li>一级菜单
<ul class="second">
<li>二级菜单</li>
<li>二级菜单</li>
<li>二级菜单</li>
<li>二级菜单</li>
</ul>
</li>
<li>一级菜单</li>
<li>一级菜单</li>
<li>一级菜单</li>
</ul>
</div>
</body>
</html>