简单选项卡制作
CSS页面代码:
body{
margin:10px;
width:600px;
}
#content{
border-left:1px solid #11a3ff;
border-right:1px solid #11a3ff;
border-bottom:1px solid #11a3ff;
padding:5px;
font-size:12px;
}
ul#tabnav{
list-style-type:none;
margin:0;
padding-left:0;
padding-bottom:23px;
border-bottom:1px solid #11a3ff;
font:bold 12px Verdana, Geneva, sans-serif;
}
ul#tabnav li{
float:left;
height:22px;
background-color:#a3dbff;
margin:0 3px 0 0;
border:1px solid #11aeff;
}
body#home ul#tabnav li.home,
body#dev ul#tabnav li.dev,
body#design ul#tabnav li.design,
body#map ul#tabnav li.map{
border-bottom:1px solid #fff;
color:#000;
background-color:#fff;
}
ul#tabnav a:link, ul#tabnav a:visited{
display:block;
color:#006eb3;
text-decoration:none;
padding:5px 10px 3px 10px;
}
ul#tabnav a:hover{
background-color:#006eb3;
color:#fff;
}
body#home li.home a:link, body#home li.home a:visited,
body#dev li.dev a:link, body#dev li.dev a:visited,
body#design li.design a:link, body#design li.design a:visited,
body#map li.map a:link, body#map li.map a:visited{
color:#000;
background-color:#fff;
}
body#home li.home a:hover, body#dev li.dev a:hover, body#design li.design a:hover, body#map li.map a:hover{
color:#006eb3;
text-decoration:underline;
}
html页面:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="tab.css" type="text/css" rel="stylesheet" /> <!--注意连接-->
</head>
<body id="home">
<ul id="tabnav">
<li class="home"><a href="home.html">Home</a></li>
<li class="dev"><a href="dev.html">Web Dev</a></li>
<li class="design"><a href="design.html">Web Design</a></li>
<li class="map"><a href="map.html">Map</a></li>
</ul>
<div id="content">
<ul id="list">
<li>1.There are some good news.</li>
<li>2.Not only good news.</li>
<li>3.The text here are example.</li>
<li>4.Not only good news.</li>
<li>5.The text here are example.</li>
</ul>
<div>
</body>