电脑技术学习

网页教学网构建DIV+CSS网页菜单代码(8)

dn001

<!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">
<!--
#navcontainer
{
margin: 0;
padding: 0 0 0 12px;
}

#navcontainer UL
{
list-style: none;
margin: 0;
padding: 0;
border: none;
}

#navcontainer LI
{
display: block;
margin: 0;
padding: 0;
float: left;
width: auto;
}

#navcontainer A
{
color: #444;
display: block;
width: auto;
text-decoration: none;
background: #DDDDDD;
margin: 0;
padding: 2px 10px;
border-left: 1px solid #fff;
border-top: 1px solid #fff;
border-right: 1px solid #aaa;
}

#navcontainer A:hover, #navcontainer A:active { background: #BBBBBB; }

#navcontainer A.active:link, #navcontainer A.active:visited
{
position: relative;
z-index: 102;
background: #BBBBBB;
font-weight: bold;
}

#subnav
{
position: relative;
top: -1px;
z-index: 101;
margin: 0;
padding: 0px 0 3px 0;
background: #BBBBBB;
border-top: 1px solid #fff;
border-bottom: 1px solid #aaa;
}

#subnav UL
{
list-style: none;
margin: 1px 0 0px 13px;
padding: 0px;
border-right: 1px solid #fff;
border-left: 1px solid #aaa;
}

#subnav LI
{
position: relative;
z-index: 102;
display: block;
margin: 0;
padding: 0;
float: left;
width: auto;
}

#subnav A
{
color: #fff;
display: block;
width: auto;
text-decoration: none;
margin: 0;
padding: 2px 12px 2px 10px;
}

#subnav A:hover, #subnav A:active { color: #444; }
#subnav A.active:link, #subnav A.active:visited { color: #444; }
#subnav BR, #navcontainer BR { clear: both; }
-->
</style>
</head>

<body>
<div id="navcontainer">
<ul id="navlist">
<li id="active"><a href="#" id="current">Item one</a></li>
<li><a href="#">Item two</a></li>
<li><a href="#">Item three</a></li>
<li><a href="#">Item four</a></li>
<li><a href="#">Item five</a></li>
</ul>
</div>
</body>
</html>