我在下面制作了这个 css 代码来为链接创建一个类,并且不将 css 应用于每个 a 标签,而只是应用于具有该类的标签,但它不起作用。
.redlink
{
color: red;
font-family: 'Finger Paint', cursive;
}
.redlink.a.link
{
text-decoration: none;
color: red;
font-family: 'Finger Paint', cursive;
}
.redlink.a.hover
{
text-decoration: none;
color: orange;
font-family: 'Finger Paint', cursive;
}
.redlink.a.visited
{
text-decoration: none;
color: red;
font-family: 'Finger Paint', cursive;
}
.redlink.a.active
{
text-decoration: none;
color: red;
font-family: 'Finger Paint', cursive;
}
.redlink.a.
{
text-decoration: none;
color: red;
font-family: 'Finger Paint', cursive;
}
好的,所以我的代码的重点是将类 redlink 作为用于 a 标签的类,这是我第一次尝试这样做。基本上,除了基本的 .redlink 类之外,代码不能正常工作,这里是 html:
<a href="#" class="redlink">I should light up orange!</a>