我有一个按钮嵌入在我的导航栏,我想知道如何改变按钮的字体颜色,而不改变导航栏文本颜色的其余部分。更改按钮字体的文本颜色,在导航栏内
按钮是在灰色文本的绿色背景。需要使绿色的白色文字保持灰色,同时保持其他标签文字为灰色
.button2 {
-moz-appearance: none;
-webkit-appearance: none;
-o-appearance: none;
-ms-appearance: none;
appearance: none;
background: #82b440;
border-radius: 1em;
border: solid;
border-color: #82b440;
color: #82b440;
cursor: pointer;
display: inline-block;
height: 4em;
padding: 0em 1.3em;
letter-spacing: 1px;
text-align: center;
text-decoration: none;
text-transform: uppercase;
font-size: 1.4em;
text-decoration-color: white;
-moz-transition: all 0.35s ease-in-out;
-webkit-transition: all 0.35s ease-in-out;
-o-transition: all 0.35s ease-in-out;
-ms-transition: all 0.35s ease-in-out;
transition: all 0.35s ease-in-out;
}
<div id="header">
<div class="container">
<!-- Logo -->
<a href="index">
<img src="images/Picture2.png">
</a>
<!-- Nav -->
<nav id="nav">
<ul>
<li><a href="page">Other Page Text</a>
</li>
**
<li><a href="quote" class="button2">Button Text</a>
</li>**
</ul>
</nav>
</div>
</div>
我不太明白?你不能像刚才那样瞄准.button2类吗?这将确保只有该按钮(或具有相同类别的其他按钮)受到影响。 –
'颜色:#82b440;'改变这一点。 – Scott
我试过了,它似乎是导航。 UL认证。 li字体颜色会明确地取代按钮中的颜色更改。颜色:#82b440(绿色)实际上是无用的,因为文本内的文本当前是灰色的,因为那是导航。 UL认证。李。定义它是。 – Kyle