Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
HTML中未加下划线的链接_Html_Css - Fatal编程技术网

HTML中未加下划线的链接

HTML中未加下划线的链接,html,css,Html,Css,如何在HTML中获取不带下划线的链接?您可能希望在CSS中这样做 a { text-decoration: none; } 或者,作为内联样式: <a href="http://foo.bar/something" style="text-decoration:none">link</a> 对于一个链接,请使用style=“文本装饰:无” 如果您希望整个站点都使用它: <style> a { text-decoration:none; } </

如何在HTML中获取不带下划线的链接?

您可能希望在CSS中这样做

a {
  text-decoration: none;
}
或者,作为内联样式:

<a href="http://foo.bar/something" style="text-decoration:none">link</a>

对于一个链接,请使用style=“文本装饰:无”

如果您希望整个站点都使用它:

<style> a { text-decoration:none; } </style>
a{文本装饰:无;}

使用CSS。需要设置的属性是
文本装饰:无

猜猜你的下一个问题是什么

a {
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

可通过以下方式进行:
1) 如果要从特定链接中删除下划线,请使用


它将抑制每个锚标记的下划线。

正如上面提到的,但我不会使用内联样式

而是为所有不希望加下划线的链接设置一个类

<a href=#" class="nolines">Your link</a>
a { text-decoration: none; }
<a href=#" class="nolines">Your link</a>
a.nolines{text-decoration:none;}