noob-fella noob-fella - 3 days ago 5
CSS Question

how to remove border in the top navbar-inverse navbar-collapse

enter image description here

How can I remove this border in the top when I open the collapse menu on boostrap? I tried used this :

.navbar-inverse .navbar-collapse,
.navbar-inverse .navbar-form {
border:0 !important;
}


but the border still there, someone know how can I remove it? thanks

jsfiddle:
http://jsfiddle.net/x2pL74aw/3/

html:

<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">WebSiteName</a>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">Page 1</a></li>
<li><a href="#">Page 2</a></li>
</ul>
</div>
</div>
</nav>


css:

.navbar-inverse .navbar-collapse,
.navbar-inverse .navbar-form {
border:0 !important;
}

Answer

Remove box-shadow & border-color from .navbar-collapse. Like:

.navbar-collapse {
  box-shadow: none;
  border-color: none;
}

Have a look at the snippet below:

.navbar-collapse {
  box-shadow: none !important;
  border: none !important;
}
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet"/>
<nav class="navbar navbar-inverse">
  <div class="container-fluid">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>                        
      </button>
      <a class="navbar-brand" href="#">WebSiteName</a>
    </div>
    <div class="collapse navbar-collapse" id="myNavbar">
      <ul class="nav navbar-nav">
        <li class="active"><a href="#">Home</a></li>
        <li><a href="#">Page 1</a></li>
        <li><a href="#">Page 2</a></li>
      </ul>
    </div>
  </div>
</nav>


<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>

Hope this helps!

Comments