gpt4 book ai didi

html - 为什么我的链接不是黄色的

转载 作者:行者123 更新时间:2023-11-28 13:16:28 25 4
gpt4 key购买 nike

所以我有一个导航,但由于某种原因我的链接不是黄色的,即使它被选中。

  <div class="link-selected" id="navbutton"><a href="index.html">Home</a></div>
<div id="navbutton"><a href="expertise.html">Expertise</a></div>
<div id="navbutton"><a href="doctors.html">Doctors</a></div>
<div id="navbutton"><a href="facility.html">Facility</a></div>
<div id="navbutton"><a href="contacts.html">Contacts</a></div>

#nav #navbutton{
width: 180px;
height: 30px;
float:left;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size: 14pt;
color:#FFF;
text-align:center;
margin-top: 1px;
}
#nav #navbutton a{
width: 180px;
height: 30px;
float:left;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size: 14pt;
color:#FFF;
text-align:center;
margin-top: 1px;
text-decoration:none;
}
#nav #navbutton.link-selected{
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size: 14pt;
color:#ece60a;
text-align:center;
margin-top: 1px;
}

最佳答案

color 属性适用于每个单独的元素。 div 元素是黄色的,但这并不重要,因为其中的链接是 color: #FFF 而不是 color: inherit

关于html - 为什么我的链接不是黄色的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17383527/

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