如何在单个html页面中使用不同的vlink颜色?我输入了vlink,它控制了整个页面中的所有vlink。另一方面,我希望在特定的部分有不同的vlink颜色。我尝试将vlink属性作为样式放在标签中,该标签已经在css文件中使用了一个样式类。我试过了:
<div class="box" style="vlink:#FFFFFF">但它搞乱了盒子的样式,vlink的白色也没有出来。我做错什么了?提前谢谢。
发布于 2010-07-12 14:42:23
为all链接创建如下样式表,为需要不同颜色的链接创建class1
A:visited - will do the work for you
<style type="text/css">
A:link {text-decoration: none}
A:visited {text-decoration: none}
A:active {text-decoration: none}
A:hover {text-decoration: underline; color: red;}
.class1 A:link {text-decoration: none}
.class1 A:visited {text-decoration: none}
.class1 A:active {text-decoration: none}
.class1 A:hover {text-decoration: underline; color: red;}
</style>检查示例:http://www.echoecho.com/csslinks.htm#
发布于 2010-07-12 14:50:28
我的建议是在您希望访问的链接以不同方式显示的包含元素中添加一个类,这样您就不必向其中的所有链接添加类……例如:
a { text-decoration: none }
a:visited { color: blue }
a:hover { text-decoration: underline; color: green }
.altLinks a:visited { color: red }然后:
<div class="altLinks">
<a href="#">This link will be red once it's been visited.</a>
</div>
<a href="#">This link will be blue once it's been visited.</a>
Both links will be green on hover.发布于 2010-07-12 14:40:33
您可以为不同链接的a:visited使用不同的类,并获得所需的结果。
https://stackoverflow.com/questions/3226358
复制相似问题