使个把链接不受CSS控制

来源:百度知道 编辑:UC知道 时间:2024/04/29 02:33:50
在网页中使用了CSS后,比如说链接都会受到CSS控制,但我想要其中几个与众不同,请问该怎么办~

<a href="#"><span style="color:red;">这样这个链接就是红色的了,不受CSS控制。</span></a>

可以多定义几个针对a 标签的定义,比如:
你已经定义了:
a:link {
font-weight: bold;
text-decoration: none;
font-family: Trebuchet MS, Tahoma, Verdana, Arial, Helvetica, sans-serif;
color: #007ac2;
font-size: 12px;
}
a:visited {
font-weight: bold;
text-decoration: none;
color: #007ac2;
}
a:hover {
font-weight: bold;
text-decoration: underline;
color: #45ace8;
}

你还可以定义一个叫 another1 的,然后在要求不一样的连接标签<a>中写class="another1",即:<a class="another1">
a.another1:link {
font-weight: normal;
text-decoration: none;
font-family: Trebuchet MS, Tahoma, Verdana, Arial, Helvetica, sans-serif;
color: #007ac2;
}
a.another1:visited {
font-weight: normal;
text-decoration: none;
color: #007ac2;
}