经典的蓝色JS+CSS下拉菜单
2011-10-13 15:51
453 查看
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %>
<!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 runat="server">
<title>无标题页</title>
<style type="text/css">
*{margin:0;padding:0;border:0;}
#div_center { width:790px; height:23px; background:#003399; margin-left: auto;margin-right:auto;}
#nav { line-height: 20px; list-style-type: none; margin-top:5px;}
#nav a { display: block; width: 77px; text-align:center; font-size:12px;}
#nav a:link { color:#FFF; text-decoration:none;margin:0;}
#nav a:visited {color:#FFF;text-decoration:none;margin:0;}
#nav a:hover {color:#C00;text-decoration:none;}
#nav li {float: left;}
#nav li a:hover{background:#FFFFFF;}
#nav li ul {line-height: 24px; background:#FFF; list-style-type: none;text-align:left;left: -999em; width:132px; position: absolute;border-width: 1px;border-top-style: none;border-right-style: solid;border-bottom-style: solid;border-left-style: solid;border-color: #003399; padding:1px;}
#nav li ul a{display:block; width: 130px;text-align:left;padding-left:2px;}
#nav li ul a:link {color:#0d5097; text-decoration:none;}
#nav li ul a:visited {color:#0d5097;text-decoration:none;}
#nav li ul a:hover {color:#FFF;text-decoration:none;font-weight:normal;background:#003399;}
#nav li:hover ul {left: auto;}
#nav li.sfhover ul {left: auto;}
#content {clear: left;}
</style>
<script type="text/javascript">
function menuFix() {
var sfEls = document.getElementById("nav").getElementsByTagName("li");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className+=(this.className.length>0? " ": "") + "sfhover";
}
sfEls[i].onMouseDown=function() {
this.className+=(this.className.length>0? " ": "") + "sfhover";
}
sfEls[i].onMouseUp=function() {
this.className+=(this.className.length>0? " ": "") + "sfhover";
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"),
"");
}
}
}
window.onload=menuFix;
</script>
</head>
<body>
<form id="form1" runat="server">
<div id=div_center>
<UL id=nav>
<LI style="MARGIN-LEFT: 10px"><A href="#">主站索引</A></LI>
<LI><A href="#">新闻中心</A>
<UL>
<LI><A href="#">·新闻中心1</A></LI>
<LI><A href="#">·新闻中心3</A></LI></UL></LI>
<LI><A href="#">企业简介</A>
<UL>
<LI><A href="#">·企业简介</A></LI>
<LI><A href="#">·产品中心</A></LI>
<LI><A href="#">·服务专区</A></LI></UL></LI>
<LI><A href="#">文章中心</A>
<UL>
<LI><A href="#">·文章中心</A></LI>
<LI><A href="#">·文章中心</A></LI></UL></LI>
<LI><A href="#">国际新闻</A>
<UL>
<LI><A href="#">国际新闻</A></LI>
<LI><A href="#">国内新闻</A></LI>
<LI><A href="#">科技新闻</A></LI></UL></LI>
<LI><A href="#">图片新闻</A>
<UL>
<LI><A href="#">·图片中心</A></LI>
<LI><A href="#">·图片中心</A></LI></UL></LI>
<LI><A href="#">下载中心</A>
<UL>
<LI><A href="#">·常用软件</A></LI>
<LI><A href="#">·文档下载</A></LI>
<LI><A href="#">社区论坛</A></LI></UL>
</div>
</form>
</body>
</html>
<!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 runat="server">
<title>无标题页</title>
<style type="text/css">
*{margin:0;padding:0;border:0;}
#div_center { width:790px; height:23px; background:#003399; margin-left: auto;margin-right:auto;}
#nav { line-height: 20px; list-style-type: none; margin-top:5px;}
#nav a { display: block; width: 77px; text-align:center; font-size:12px;}
#nav a:link { color:#FFF; text-decoration:none;margin:0;}
#nav a:visited {color:#FFF;text-decoration:none;margin:0;}
#nav a:hover {color:#C00;text-decoration:none;}
#nav li {float: left;}
#nav li a:hover{background:#FFFFFF;}
#nav li ul {line-height: 24px; background:#FFF; list-style-type: none;text-align:left;left: -999em; width:132px; position: absolute;border-width: 1px;border-top-style: none;border-right-style: solid;border-bottom-style: solid;border-left-style: solid;border-color: #003399; padding:1px;}
#nav li ul a{display:block; width: 130px;text-align:left;padding-left:2px;}
#nav li ul a:link {color:#0d5097; text-decoration:none;}
#nav li ul a:visited {color:#0d5097;text-decoration:none;}
#nav li ul a:hover {color:#FFF;text-decoration:none;font-weight:normal;background:#003399;}
#nav li:hover ul {left: auto;}
#nav li.sfhover ul {left: auto;}
#content {clear: left;}
</style>
<script type="text/javascript">
function menuFix() {
var sfEls = document.getElementById("nav").getElementsByTagName("li");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className+=(this.className.length>0? " ": "") + "sfhover";
}
sfEls[i].onMouseDown=function() {
this.className+=(this.className.length>0? " ": "") + "sfhover";
}
sfEls[i].onMouseUp=function() {
this.className+=(this.className.length>0? " ": "") + "sfhover";
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"),
"");
}
}
}
window.onload=menuFix;
</script>
</head>
<body>
<form id="form1" runat="server">
<div id=div_center>
<UL id=nav>
<LI style="MARGIN-LEFT: 10px"><A href="#">主站索引</A></LI>
<LI><A href="#">新闻中心</A>
<UL>
<LI><A href="#">·新闻中心1</A></LI>
<LI><A href="#">·新闻中心3</A></LI></UL></LI>
<LI><A href="#">企业简介</A>
<UL>
<LI><A href="#">·企业简介</A></LI>
<LI><A href="#">·产品中心</A></LI>
<LI><A href="#">·服务专区</A></LI></UL></LI>
<LI><A href="#">文章中心</A>
<UL>
<LI><A href="#">·文章中心</A></LI>
<LI><A href="#">·文章中心</A></LI></UL></LI>
<LI><A href="#">国际新闻</A>
<UL>
<LI><A href="#">国际新闻</A></LI>
<LI><A href="#">国内新闻</A></LI>
<LI><A href="#">科技新闻</A></LI></UL></LI>
<LI><A href="#">图片新闻</A>
<UL>
<LI><A href="#">·图片中心</A></LI>
<LI><A href="#">·图片中心</A></LI></UL></LI>
<LI><A href="#">下载中心</A>
<UL>
<LI><A href="#">·常用软件</A></LI>
<LI><A href="#">·文档下载</A></LI>
<LI><A href="#">社区论坛</A></LI></UL>
</div>
</form>
</body>
</html>
相关文章推荐
- 经典的蓝色JS+CSS下拉菜单
- JS+CSS实现的经典圆角下拉菜单效果代码
- 经典的蓝色CSS下拉菜单
- JS+CSS实现的经典圆角下拉菜单效果代码
- 采用CSS和JS,刚好我最近有个站点要用到下拉菜单!
- 采用CSS和JS的下拉菜单
- 下拉菜单的两种实现方式:CSS和JS
- 30多个CSS和JS下拉菜单资源
- 纯css下拉菜单 无需js
- 纯DIV+CSS制作的下拉菜单,二级下拉菜单,三级下拉菜单(无JS)
- CSS+JS实现兼容性很好的无限级下拉菜单
- 很漂亮的蓝色经典CSS导航菜单代码
- 采用CSS和JS的下拉菜单
- [HTML] CSS + JS 多级下拉菜单
- css+jquery(js)写下拉菜单
- [JavaScript] JS+CSS 制作超级简单的下拉菜单
- js+CSS实现模拟华丽的select控件下拉菜单效果
- css+js制作下拉菜单的例子
- 一款JS+CSS打造绝对经典的资讯网站滑动门特效
- CSS+JS实现兼容性很好的无限级下拉菜单