我做了兩個列表,一個是水平的,另一個是垂直的,每個都有不同的外觀。如何處理兩個不同的垂直和水平列表
如何分別爲它們指定(a:link,a:visited,a:hover,a:active)屬性?
頂部水平菜單
<!DOCTYPE>
<html>
<head>
<link rel="stylesheet" type="text/css" href="d.css"/>
<title></title>
</head>
<body>
<ul id="topp">
<li class="tl"><a href="#" class="ta"> Home </a></li>
<li class="tl"><a href="#" class="ta"> New Products </a></li>
<li class="tl"><a href="#" class="ta"> Specials </a></li>
<li class="tl"><a href="#" class="ta"> Contact </a></li>
</ul>
</body>
</html>
頂部橫向菜單CSS文件
@charset "utf-8";
/* CSS Document */
#container{
border-style:solid;
border-width:thin;
background-color:green;
height:100%;
}
.inner{
border-style:solid;
border-width:thin;
background-color:#0C3;
height:600px;
width:90%;
position:absolute;
left:50px;
}
#head{
background-color:#FF9;
height:100px;
width:80%;
position:absolute;
top:0;
bottom:550;
left:0;
right:0;
margin:auto;
}
#topp{
list-style-type:none;
margin:0;
padding:0;
position:absolute;
top:100;
bottom:550;
left:300;
right:0;
margin:auto;
}
.ta{ /*Top menu anchor*/
display:block;
width:100px;
}
.tl{ /*top menu list*/
background-color:#3F6;
border-style:solid;
border-width:thin;
float:left;
text-align:center;
}
a:link,a:visited
{
display:block;
font-weight:bold;
color:#FFFFFF;
background-color:#98bf21;
width:120px;
text-align:center;
padding:4px;
text-decoration:none;
}
a:hover,a:active
{
background-color:#FF9;
color:#000;
}
垂直菜單
<!DOCTYPE>
<html>
<head>
<link rel="stylesheet" type="text/css" href="leftm.css"/>
<title></title>
</head>
<body>
<div class="arrowgreen">
<ul class="glossymenu">
<li><a href="#" class="selected" title="Home">Home</a></li>
<li><a href="#" title="new products">new products</a></li>
<li><a href="#" title="specials">specials</a></li>
<li><a href="#" title="Contact">Contact</a></li>
</ul>
</div>
</body>
</html>
垂直菜單的CSS網絡樂
@charset "utf-8";
/* CSS Document */
.arrowgreen{
width: 180px; /*width of menu*/
border-style: solid solid none solid;
border-color: #94AA74;
border-size: 1px;
border-width: 1px;
}
.arrowgreen ul{
list-style-type: none;
margin: 0;
padding: 0;
}
.arrowgreen li a{
font: bold 12px Verdana, Arial, Helvetica, sans-serif;
display: block;
background: transparent url(media/arrowgreen.gif) 100% 0;
height: 24px; /*Set to height of bg image- padding within link (ie: 32px - 4px - 4px)*/
padding: 4px 0 4px 10px;
line-height: 24px; /*Set line-height of bg image- padding within link (ie: 32px - 4px - 4px)*/
text-decoration: none;
}
.arrowgreen li a:link, .arrowgreen li a:visited {
color: #5E7830;
}
.arrowgreen li a:hover{
color: #26370A;
background-position: 100% -32px;
}
/*.arrowgreen li a.selected{
color: #26370A;
background-position: 100% -64px;
}
*/
向我們顯示您的代碼。 – Nitesh