我一直试图将标题中的链接更改为#000000,但是由于某种原因,它似乎并没有改变颜色。我只想更改标题中的链接,而不要更改其余的链接。下面是示例:
HTML:
<a class="submit-a-request" href="/hc/en-us/requests/new">Submit a request</a>
CSS:
a {
color: #022550;
font-family: 'Nunito Sans', sans-serif;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
这是我尝试过的:
.submit-a-request a:link {
color: #000000;
}
这:
a.submit-a-request {
color: #000000;
}
有人可以请教吗?谢谢。
答案 0 :(得分:1)
好像您没有将CSS定位到正确的元素。试试这个:
a.submit-a-request {
color: #000000;
}
/* Next line is optional - enter your own hex color for hover */
a.submit-a-request:hover {
color: #000000;
}
答案 1 :(得分:0)
a {
color: green;
font-family: 'Nunito Sans', sans-serif;
text-decoration: none;
}
a:hover {
text-decoration: underline;
color:purple;
}
a:active{
color:orange;
}
<a class="submit-a-request" href="#">Submit a request</a>