bootstrap 4单击时删除下划线

时间:2017-11-25 02:39:11

标签: html css twitter-bootstrap

我在删除导航栏中单击菜单时出现的下划线时遇到问题,这是我使用的代码。但它不起作用!

a.nav-link, a.nav-link:hover, a.nav-link:active, a.nav-link:visited, a.nav-link:focus {
    text-decoration:none;
}

没有运气。

  

我使用bootstrap 4 alpha

4 个答案:

答案 0 :(得分:2)

您可以删除所有标记中的下划线

 a, a:hover,a:visited, a:focus {
    text-decoration:none;
}

答案 1 :(得分:1)

在bootstrap 4中,您只需添加

.text-decoration-none

上课,您的工作就完成了。

答案 2 :(得分:0)

你是否在bootstrap库之后加载你的css,例如:

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-beta/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="style.css">

在这种情况下,style.css上的css将胜过bootstrap css

如果有帮助,请告诉我!

答案 3 :(得分:0)

x-window-manager & #gnome-terminal & 对变量和混合使用Bootstrap 4,覆盖链接默认行为的最简单方法是定义一个自定义类,如下所示:

Sass

您的html文件:

.non-underline-link{
   text-decoration: none !important;
}

然后在您的项目中重新编译它。 有关更多信息,请访问HERE