选择的链接颜色

时间:2012-01-27 02:17:37

标签: css hyperlink

我正在尝试将我的链接设置为一种颜色(灰色),当鼠标悬停时,它会变为绿色,当点击时,绿色会保持不变。当点击一个新的链接时,该链接变回灰色而另一个STAYS变为绿色等。除了点击一个链接时留下的绿色,我已经完成了所有工作。我能做什么?谢谢!

<div id="navBar">
<font face="abeatbyKai">
<ul id="menu-list"> 
  <li><a class="menu_side" href="webpages/News.html" style="text-decoration: none" id="one">News</a></li> 
  <li><a class="menu_side" href="webpages/About Us.html" style="text-decoration: none" id="two">About Us</a></li> 
  <li><a class="menu_side" href="webpages/Gallery.html" style="text-decoration: none" id="three">Gallery</a></li> 
  <li><a class="menu_side" href="webpages/Affiliates.html" style="text-decoration: none" id="four">Affiliates</a></li> 
  <li><a class="menu_side" href="webpages/Biography.html" style="text-decoration: none" id="five">Biography</a></li> 
  <li><a class="menu_side" href="webpages/Contact.html" style="text-decoration: none" id="six">Contact</a></li>
</ul>
</font>
</div>




#menu {
width: 275px;
left: 0;
right: 0;
top:0;
bottom: 0;
position: absolute;
overflow: auto;
background: rgba(0,0,0,1);
border-right-width: 7px;
border-right-style: solid;
border-right-color: #000;
}
#navBar {
width: 225px;
height:260px;
left: 50px;
right: 0;
top:200px;
bottom: 0;
position: absolute;
overflow:hidden;
background:rgba(86,86,86,0);
font-size: 35px;
}
#menu-list {
padding:0; 
margin:0;

}
#menu-list li { 
list-style-type:none;
margin-bottom: 7px;
}

#menu-list a#one:link, a#two:link, a#three:link, a#four:link, a#five:link, a#six:link{
color: #5e5e5e;
}

#menu-list a#one:visited, a#two:visited, a#three:visited, a#four:visited, a#five:visited, a#six:visited {
color: #5e5e5e;
}

#menu-list a#one:active, a#two:active, a#three:active, a#four:active, a#five:active, a#six:active {
color: #07CB25;
}

#menu-list a#one:hover, a#two:hover, a#three:hover, a#four:hover, a#five:hover, a#six:hover{
color: #07CB25;
}

#main {
left: 275px;
right: 0;
top:0;
bottom: 0;
position: absolute;
overflow: auto;
background: rgba(16,16,16,0.6);
}

#gallery1 {
width:475px;
left:250px;
top: 500px;
position: absolute;

}
a {
outline: 0;
}

1 个答案:

答案 0 :(得分:0)

最简单的方法是将链接设置为灰色以表示链接和访问,绿色表示悬停和活动。然后,在每个单独的页面上添加一个&#34;当前&#34; class到表示当前页面的链接。样式链接在当前类中始终为绿色。

相关问题