带滚动条的二级黑色竖直菜单(CSS实现)

代码简介:

CSS实现带滚动条的二级竖直菜单,绝对值得推荐给大家,效果不错,从整体上来说与普通的二级菜单区别不大,只是在二级菜单项目过多的时候,本菜单就显出了优势,会自动出现滚动条,从页不溢出你的规定区域,而且本菜单符合W3C标准,兼容性非常好。

代码内容:

<!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>
<title>带滚动条的二级黑色竖直菜单(CSS实现)_网页代码站(www.webdm.cn)</title>
</head>
<style type="text/css">
.menu 
{font-family: verdana, arial, sans-serif; width:500px; padding:20px 0 100px 100px; position:relative;z-index:100;}
.menu ul 
{padding:0; margin:0; list-style-type: none; border:0;}
.menu ul li 
{float:left; position:relative; margin-right:1px;}
.menu ul li a, 
.menu ul li a:visited 
{display:block; text-align:left; text-decoration:none; width:150px; height:25px; color:#aaa; background:#fff url

(http://www.webdm.cn/images/20090914/tab.gif); line-height:24px; font-size:11px; text-indent:10px;}
table {border-collapse:collapse;margin:0; padding:0;}
.menu ul li ul {display:none; text-align:left; position:absolute; top:25px; left:-20px; text-align:left;z-index:100; padding:0 30px 20px 20px; 

background:url(http://www.webdm.cn/images/20090914/tab_bot.gif) 20px 100% no-repeat;}
.menu ul li:hover a, 
.menu ul li a:hover
{color:#fff; border:0;}
.menu ul li:hover ul, 
.menu ul li a:hover ul
{display:block;}
.menu ul li:hover ul li, 
.menu ul li a:hover ul li
{background:#363636; color:#000; width:149px; height:100px;overflow:auto; border-left:1px solid #7a7a7a;}
/* http://www.webdm.cn hack the widht for IE5.5 */
* html .menu ul li a:hover ul li {width:150px; w\idth:149px;}
.menu ul li:hover ul li a, 
.menu ul li a:hover ul li a
{float:left; display:block; background:#363636; color:#aaa; width:129px; text-align:left; text-decoration:none; border:0; text-indent:10px;}
.menu ul li:hover ul li a:hover,
.menu ul li a:hover ul li a:hover
{text-decoration:none; color:#fff; background:#222;}
</style>
<!--[if lt IE 7]>
<style type="text/css">
.menu ul li ul {display:block; visibility:hidden;}
.menu ul li a:hover ul {visibility:visible;}
</style>
<![endif]-->
<!--[if IE]>
<style type="text/css">
.menu ul li:hover ul li,
.menu ul li a:hover ul li
{
scrollbar-arrow-color: #aaa;
scrollbar-3dlight-color: #888;
scrollbar-highlight-color: #666;
scrollbar-face-color: #444;
scrollbar-shadow-color: #000;
scrollbar-darkshadow-color: #888;
scrollbar-track-color: #363636;
}
</style>
<![endif]-->
<body>
<div class="menu">

<ul>
<li><a class="hide" href="http://www.webdm.cn">网页代码站官方站<!--[if IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
	<ul>
	<li>
<a href="/">最新更新</a>
<a href="/">下载排行</a>
<a href="http://www.webdm.cn">网站留言</a>
<a href="/">Georgia</a>
<a href="/">ASP</a>
<a href="/">PHP</a>
<a href="http://www.webdm.cn">ASP.NET</a>
<a href="/">JQUERY</a>
<a href="http://www.webdm.cn">EXT</a>
<a href="/">MOOTOOLS</a>
<a href="/">WebDm.cn</a>
	</li>
	</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>
<li><a class="hide" href="/">精品网页特效代码<!--[if IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
	<ul>
	<li>
<a href="http://www.webdm.cn">菜单导航</a>
<a href="/">层和布局</a>
<a href="/">浏览器</a>
<a href="/">Derbyshire</a>
<a href="/">计算</a>
<a href="http://www.webdm.cn">Durham</a>
<a href="/">表单</a>
<a href="/">Essex</a>
<a href="/">按钮</a>
<a href="/">CSS</a>
<a href="/">Kent</a>
<a href="/">JavaScript</a>
<a href="/">图片</a>	
	</li>
	</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>
</ul>
</div>
</body>
</html>
<br>
<p><a href="http://www.webdm.cn">网页代码站</a> - 最专业的代码下载网站 - 致力为中国站长提供有质量的代码!</p>

代码来自:http://www.webdm.cn/webcode/839f6983-8fce-4548-a273-79d23567986e.html

posted @ 2011-02-14 13:46  网页代码站  阅读(797)  评论(0编辑  收藏  举报