在博客园里http://www.cnblogs.com/xiaojiangjiang/archive/2007/06/06/774272.aspx看到一段代码,copy下来后发现不能使用,于是上传了下面这段代码...直接copy就可以使用地...只要根据自己的具体情况加以调整即可

 

<!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=utf-8" />
<title>div下拉菜单</title>
<style type="text/css">
/* common styling */
.menu {font-family: arial, sans-serif; width:750px; position:relative; margin:0; font-size:11px; margin:50px 0;}
.menu ul li a, .menu ul li a:visited {display:block; text-decoration:none; color:#000;width:104px; height:20px; text-align:center; color:#fff; border:1px solid #fff; background:#710069; line-height:20px; font-size:11px; overflow:hidden;}
.menu ul {padding:0; margin:0;list-style-type: none; }
.menu ul li {float:left; margin-right:1px; position:relative;}
.menu ul li ul {display: none;}
/* specific to non IE browsers */
.menu ul li:hover a {color:#fff; background:#36f;}
.menu ul li:hover ul {display:block; position:absolute; top:21px; left:0; width:105px;}
.menu ul li:hover ul li a.hide {background:#6a3; color:#fff;}
.menu ul li:hover ul li:hover a.hide {background:#6fc; color:#000;}
.menu ul li:hover ul li ul {display: none;}
.menu ul li:hover ul li a {display:block; background:#ddd; color:#000;}
.menu ul li:hover ul li a:hover {background:#6fc; color:#000;}
.menu ul li:hover ul li:hover ul {display:block; position:absolute; left:105px; top:0;}
.menu ul li:hover ul li:hover ul.left {left:-105px;}
</style>
<!--[if lte IE 6]>
<style type="text/css">
.menu ul li a.hide, .menu ul li a:visited.hide {display:none;}
.menu ul li a:hover ul li a.hide {display:none;}
.menu ul li a:hover {color:#fff; background:#36f;}
.menu ul li a:hover ul {display:block; position:absolute; top:21px; left:0; width:105px;}
.menu ul li a:hover ul li a.sub {background:#6a3; color:#fff;}
.menu ul li a:hover ul li a {display:block; background:#ddd; color:#000;}
.menu ul li a:hover ul li a ul {visibility:hidden;}
.menu ul li a:hover ul li a:hover {background:#6fc; color:#000;}
.menu ul li a:hover ul li a:hover ul {visibility:visible; position:absolute; left:105px; top:0; color:#000;}
.menu ul li a:hover ul li a:hover ul.left {left:-105px;}
</style>
<![endif]-->
</head>
<body>
<div class="menu">
<ul>
<li><a class="hide" href="#">DEMOS</a>
<!--[if lte IE 6]>
<a href="#">DEMOS
<table><tr><td>
<![endif]-->
<ul>
<li><a href="#" title="zss">zero dollars</a></li>
<li><a href="#" title="zss">wrapping text</a></li>
<li><a href="#" title="zss">styled form</a></li>
<li><a href="#l" title="zss">active focus</a></li>
<li><a class="hide" href="#" title="zss">HOVER/CLICK ></a>
<!--[if lte IE 6]>
<a class="sub" href="#" title="zss">HOVER/CLICK &gt;
<table><tr><td>
<![endif]-->
<ul>
<li><a href="#" title="zss">styled form</a></li>
<li><a href="#" title="zss">active focus</a></li>
<li><a href="#" title="zss">hover/click</a></li>
</ul>
<!--[if lte IE 6]>
</td></tr></table>
</a>
<![endif]-->
</li>
<li><a href="#" title="zss">shadow boxing</a></li>
<li><a href="#" title="zss">image map</a></li>
<li><a href="#" title="zss">fun backgrounds</a></li>
<li><a href="#" title="zss">fade scrolling</a></li>
<li><a href="#" title="zss">em sized images</a></li>
</ul>
<!--[if lte IE 6]>
</td></tr></table>
</a>
<![endif]-->
</li>
<li><a class="hide" href="#">MENUS</a>
<!--[if lte IE 6]>
<a href="#">MENUS
<table><tr><td>
<![endif]-->
<ul>
<li><a href="#" title="zss">spies menu</a></li>
<li><a href="#" title="zss">vertical menu</a></li>
<li><a href="#" title="zss">enlarging list</a></li>
<li><a href="#" title="zss">link images</a></li>
<li><a href="#" title="zss">non-rectangular</a></li>
<li><a href="#" title="zss">jigsaw links</a></li>
<li><a href="#" title="zss">circular links</a></li>
</ul>
<!--[if lte IE 6]>
</td></tr></table>
</a>
<![endif]-->
</li>
<li><a class="hide" href="#">LAYOUTS</a>
<!--[if lte IE 6]>
<a href="#">LAYOUTS
<table><tr><td>
<![endif]-->
<ul>
<li><a href="#" title="zss">Fixed 1</a></li>
<li><a href="#" title="zss">Fixed 2</a></li>
<li><a href="#" title="zss">Fixed 3</a></li>
<li><a href="#" title="zss">Fixed 4</a></li>
<li><a href="#" title="zss">minimum width</a></li>
</ul>
<!--[if lte IE 6]>
</td></tr></table>
</a>
<![endif]-->
</li>
<li><a class="hide" href="#">BOXES</a>
<!--[if lte IE 6]>
<a href="#">BOXES
<table><tr><td>
<![endif]-->
<ul>
<li><a href="#" title="zss">spies menu</a></li>
<li><a href="#" title="zss">vertical menu</a></li>
<li><a href="#" title="zss">enlarging list</a></li>
<li><a href="#" title="zss">link images</a></li>
<li><a href="#" title="zss">non-rectangular</a></li>
<li><a href="#" title="zss">jigsaw links</a></li>
<li><a href="#" title="zss">circular links</a></li>
</ul>
<!--[if lte IE 6]>
</td></tr></table>
</a>
<![endif]-->
</li>
<li><a class="hide" href="#">MOZILLA</a>
<!--[if lte IE 6]>
<a href="../mozilla/index.html">MOZILLA
<table><tr><td>
<![endif]-->
<ul>
<li><a href="#" title="zss">drop down menu</a></li>
<li><a href="#" title="zss">cascading menu</a></li>
<li><a href="#" title="zss">content:</a></li>
<li><a href="#" title="zss">mozzie box</a></li>
<li><a href="#" title="zss">rainbow box</a></li>
<li><a href="#" title="zss">snooker cue</a></li>
<li><a href="#" title="zss">target practise</a></li>
<li><a href="#" title="zss">two tone headings</a></li>
<li><a href="#" title="zss">shadow text</a></li>
</ul>
<!--[if lte IE 6]>
</td></tr></table>
</a>
<![endif]-->
</li>
<li><a class="hide" href="#">EXPLORER</a>
<!--[if lte IE 6]>
<a href="#">EXPLORER
<table><tr><td>
<![endif]-->
<ul>
<li><a href="#" title="zss">example one</a></li>
<li><a href="#" title="zss">weft fonts</a></li>
<li><a href="#" title="zss">vertical align</a></li>
</ul>
<!--[if lte IE 6]>
</td></tr></table>
</a>
<![endif]-->
</li>
<li><a class="hide" href="#">OPACITY</a>
<!--[if lte IE 6]>
<a href="#">OPACITY
<table><tr><td>
<![endif]-->
<ul>
<li><a href="#" title="zss">opaque colours</a></li>
<li><a href="#" title="zss">opaque menu</a></li>
<li><a href="#" title="zss">partial opacity</a></li>
<li><a href="#" title="zss">partial opacity II</a></li>
<li><a class="hide" href="#" title="zss">< HOVER/CLICK</a>
<!--[if lte IE 6]>
<a class="sub" href="#" title="zss">&lt; HOVER/CLICK
<table><tr><td>
<![endif]-->
<ul class="left">
<li><a href="#" title="zss">styled form</a></li>
<li><a href="#" title="zss">active focus</a></li>
<li><a href="#" title="zss">hover/click</a></li>
</ul>
<!--[if lte IE 6]>
</td></tr></table>
</a>
<![endif]-->
</li>
</ul>
<!--[if lte IE 6]>
</td></tr></table>
</a>
<![endif]-->
</li>
</ul>
</div>
</body>
</html>