gpt4 book ai didi

css - 为单个链接专门设置颜色

转载 作者:行者123 更新时间:2023-12-03 23:46:31 24 4
gpt4 key购买 nike

我正在尝试创建一个 CSS 菜单栏,其中包含除单个链接外的所有灰色文本,但是我所做的每次尝试都会产生全灰色或全绿色链接文本。

如果您往下看,EcoSolutions 应该是绿色的,其余的应该是灰色的

我已经包含了我最近的尝试......希望有人可以结束我的疯狂:D

谢谢

<ul id='Navigation' class='MenuBar'>
<li><a href="../index.php">Home</a>
<img src='images/separator.jpg'/></li>
<li><a href="../simplify.php">Simplify</a>
<img src='images/separator.jpg'/></li>
<li><a href="../ecosolutions.php"class="green">EcoSolutions</a>
<img src='images/separator.jpg'/></li>
<li><a href="../contact_us.php">Contact</a>
<img src='images/separator.jpg'/></li>
<li><a href="../partners.php">Partners</a>
<img src='images/separator.jpg'/></li>
<li><a href="../services.php">Services</a>
<img src='images/transSeparator.png'/></li>
</ul>


/**** MenuBar STYLES ****/

.MenuBar
{
width: 916px;
padding: 0px 0px 0px 50px;
margin: 0px 0px 0px 0px;
text-align: center;
color: #888;
}
.MenuBar ul
{
list-style-type: none;
font-size: .9em;
cursor: default;
font-weight: bold;
padding: 10px 0px 0px 0px;
margin: 0px 0px 0px 0px;
font-family:Verdana, Geneva, sans-serif;
color: #888;
}

.MenuBar ul li img
{
padding: 0px 0px 0px 0px;
margin: 0px 25px 0px 25px;
vertical-align: middle;
}

.MenuBar li
{
list-style-type: none;
font-size: .9em;
position: relative;
cursor: pointer;
text-decoration: none;
text-align: center;
float: left;
height: 37px;
padding: 0px;
margin: 0px 0px 0px 0px;
top: auto;
bottom: auto;
font-family:Verdana, Geneva, sans-serif;
color: #888;
}

.green a:link, a:visited, a:active
{
display: inline;
color: #94cf01;
padding: 0px;
margin: 0px;
text-decoration: none;
}
.MenuBar ul li a:link, a:visited, a:active
{
display: inline;
cursor: pointer;
color: #888;
padding: 0px;
margin: 0px;
text-decoration: none;
}

.MenuBar ul li a:hover
{
display: inline;
color: #FF0000;
padding: 0px;
margin: 0px;
}

最佳答案

尝试更改此设置

.green a:link, a:visited, a:active 
{
display: inline;
color: #94cf01;
padding: 0px;
margin: 0px;
text-decoration: none;
}

到这里

a.green:link, a.green:visited, a.green:active 
{
display: inline;
color: #94cf01;
padding: 0px;
margin: 0px;
text-decoration: none;
}

关于css - 为单个链接专门设置颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2336300/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com