我已经尝试了text-decoration: none;
以及其他所有内容,但没有任何内容从链接下划线。这是我目前的html和css:
nav-wrapper .navbar-header a h3 {
color: #fff;
font-weight: 200;
margin-top: 10px;
letter-spacing: 4px;
}
.nav-wrapper .navbar-header a :hover,
.navbar-header a :focus {
text-decoration-line: none !important;
color: #506C69;
}
<body data-spy="scroll" data-target=".navbar-fixed-top" data-offset="65">
<header>
<nav class="navbar company-top-nav navbar-fixed-top" role="navigation">
<div class="container-fluid">
<div class="nav-wrapper">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#company-menu">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="index.html">
<h3>Some Text</h3>
</a>
</div>
答案 0 :(得分:-1)
这只是一个错字。删除元素和CSS中的状态之间的空格:
nav-wrapper .navbar-header a h3 {
color: #fff;
font-weight: 200;
margin-top: 10px;
letter-spacing: 4px;
}
.nav-wrapper .navbar-header a:hover,
.navbar-header a:focus {
text-decoration-line: none !important;
color: #506C69;
}
<body data-spy="scroll" data-target=".navbar-fixed-top" data-offset="65">
<header>
<nav class="navbar company-top-nav navbar-fixed-top" role="navigation">
<div class="container-fluid">
<div class="nav-wrapper">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#company-menu">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="index.html">
<h3>Some Text</h3>
</a>
</div>