如何获取HTML中没有下划线的链接?
答案 0 :(得分:7)
可以通过以下方式完成:
1)如果要从特定链接中删除下划线,请使用
<a href="#" style="text-decoration:none;">Some text</a>
2)要删除整个html页面的下划线,请创建一个.css文件,在该文中写下:
a { text-decoration: none; }
它将抑制每个锚标记的下划线。
答案 1 :(得分:4)
猜猜你的下一个问题是什么......
a {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
答案 2 :(得分:2)
如上所述,但我不会使用内联样式。
而是为您不希望加下划线的所有链接设置一个类。
<a href=#" class="nolines">Your link</a>
CSS:
a.nolines{text-decoration:none;}
答案 3 :(得分:1)
你可能想在CSS中这样做。
a {
text-decoration: none;
}
或者,作为内联样式:
<a href="http://foo.bar/something" style="text-decoration:none">link</a>
答案 4 :(得分:1)
对于一个链接,请使用style =“text-decoration:none”
如果您想要整个网站:
<style> a { text-decoration:none; } </style>
答案 5 :(得分:1)
使用CSS。您需要设置的属性为text-decoration: none;