包含标签"A:visited"的问题 - 有问题,问老三

有关标签‘A:visited’的问题

Laosan 于 三月 20th, 2009 回答。 分类:电脑网络.

在样式表(CSS)中,可以对连接的不同状态作出相应的设定,针对个人的要求,来完成不同的表达方式。

先来看看各种连接状态的属性:
A:link: – 正常显示的连接状态
A:visited: – 连接被访问过后的显示状态
A:active: – 连接被按下时的状态
A:hover: – 鼠标悬停在连接上的连接状态

对上述的连接,可以像对正常的文字一样,做出任何你喜欢的修饰。

<style type="text/css">
A:link {
background: #FFCC00;
font-family: sans-serif;
font-size: 14px;
color: #CC3366;
text-decoration: none
}
A:visited {
background: #FFCC00;
font-family: sans-serif;
font-size: 14px;
color: #CC3366;
text-decoration: none
}
A:active {
background: #FFCC00;
font-family: sans-serif;
font-size: 14px;
color: #CC3366;
text-decoration: none
}
A:hover {
background: #FFCC00;
font-family: sans-serif;
font-size: 14px;
color: #CC3366;
text-decoration: none
}
</style>

你可以对上面的任何一项进行调整和修改,比如你想改成文字有下划线,只要将 text-decoration: none 改成 text-decoration: underline 就可以了。
同时,有时候我们不需要对每一项都进行设定,只需要强调其中一项,那末只要写出这一项就可以了,其他的自然就是显示默认的属性。
比如:

<style type="text/css">
A:link {
color: red;
</style>

上面设定的连接,除了颜色是红色的以外,其它的属性都是默认的。

标签:, , , , , , .