想问问要在网页上去掉链接的下划线,插入什么代码?~~~我忘记了~~~

来源:百度知道 编辑:UC知道 时间:2024/05/27 19:04:21
想要不要链接链接的下划线,一时忘记代码了!!
谢谢前辈来指教~~~

用CSS来实现:
<style type="text/css">
<!--
a:link { text-decoration: none}
a:visited { text-decoration: none}
a:hover { text-decoration: none}
-->
</style>
其中a:link 表示一般的链接样式;a:visited 表示已访问过的链接样式;a:hover 表示鼠标经过时的链接样式。text-decoration: none 表示无下划线,text-decoration: underline 表示有下划线。

如果三种链接状态的样式相同,也可以简化为:
<style type="text/css">
<!--
a { text-decoration: none}
-->
</style>

<style>
a{text-decoration:none;}
a:active {color:green}
a:hover {color:red}
a:visited{color:blue}
a:link {color:blue}
</style>

上面第2行