Keeping my search bar viewable when my navbar collapses with twitter bootstrap - html

I have a nabvar that contains a search field 'navbarSearchQuery'. When the navbar collapses when the screen shrinks to a phone size I want 'navbarSearchQuery' to remain visible in the navbar. Is there something I can do with #media queries to keep it visible or do I have to move it outside the collapsable section in the navbar?
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand hidden-xs" href="/Home">Yoga</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="dropdown">
Browse <span class="caret"></span>
<ul class="dropdown-menu" role="menu">
<li>Popular
</li>
<li>Friends
</li>
<li>Groups
</li>
<li>Neighborhoods
</li>
<li>About <span class="sr-only">(current)</span>
</li>
<li>Contact
</li>
</ul>
</li>
<li>
<div class="navbar-form navbar-left">
<div class="form-group">
<input type="text" class="form-control" placeholder="Search" id="navbarSearchQuery" name="location">
</div>
</div>
</li>
</ul>
#Html.Partial("_LoginPartial")
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
</nav>

You can create a form inside the navbar-header.
/**Custom**/
.navbar.navbar-custom {
height: 50px;
border: none;
}
.navbar-custom .formSearch {
width: 300px;
float: left;
display: block;
position: absolute;
padding-top: 7px;
margin-left: 160px;
}
.navbar-custom .inner-addon {
position: relative;
}
.navbar-custom .inner-addon .glyphicon {
position: absolute;
padding: 10px;
pointer-events: none;
color: black;
}
.navbar-custom .left-addon .glyphicon {
left: 0px;
}
.navbar-custom .left-addon input {
padding-left: 30px;
}
#media (max-width: 767px) {
.navbar-custom .formSearch {
padding-left: 15px;
width: 70%;
margin-left: 0;
}
.navbar-custom .navbar-collapse {
background: #f5f5f5;
}
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<nav class="navbar navbar-default navbar-custom">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"> <span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button><a class="navbar-brand hidden-xs" href="/Home">Yoga</a>
<form class="formSearch" role="search">
<div class="inner-addon left-addon"> <span class="glyphicon glyphicon-search"></span>
<input type="text" class="form-control" placeholder="Search" id="navbarSearchQuery" name="location">
</div>
</form>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="dropdown"> Browse <span class="caret"></span>
<ul class="dropdown-menu" role="menu">
<li>Popular
</li>
<li>Friends
</li>
<li>Groups
</li>
<li>Neighborhoods
</li>
<li>About <span class="sr-only">(current)</span>
</li>
<li>Contact
</li>
</ul>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
</nav>

I can put the navbar in the header part but when I shrink the alignment is slightly off. Can this be fixed?
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand hidden-xs" href="/Home">Yoga</a>
<div class="navbar-form navbar-left navbar-search">
<div class="form-group">
<input type="text" class="form-control" placeholder="Search" id="navbarSearchQuery" name="location">
</div>
</div>
</div>
before and after pics. you can see the button isn't aligned correctly

Related

Fixed Search Box in Bootstrap Navbar [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
I'm trying to figure out how to make the search box fixed in the navigation bar instead of being part of the dropdown menu. The final output would be something similar to the image below.
<div class="container-fluid">
<!-- add header -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<!-- add menu -->
<div class="collapse navbar-collapse" id="navbar1">
<ul class="nav navbar-nav">
<li class="active">Home</li>
<li>About</li>
<li>Services</li>
</ul>
<!-- add search form -->
<form class="navbar-form navbar-right" role="search">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search this site">
<span class="input-group-btn">
<button type="submit" class="btn btn-default">
<span class="glyphicon glyphicon-search"></span>
</button>
</span>
</div>
</form>
</div>
</div>
Here's the code I'm currently working on: http://www.bootply.com/fb311f2zSJ#
Try this:
#import url('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css');
/* CSS used here will be applied after bootstrap.css */
.navbar-header form {
position: absolute;
right: 20px;
max-width: 250px;
}
button.navbar-toggle.pull-left {
margin-left: 15px;
}
#media only screen and (max-width:768px){
.navbar-inverse .navbar-collapse, .navbar-inverse .navbar-form {
border-color: rgba(0,0,0,0);
margin-top: 0;
padding-top: 8px;
}
.navbar-form {
padding: 10px 15px;
margin-top: 8px;
margin-right: -15px;
margin-bottom: 8px;
margin-left: -15px;
border-top: 0px solid transparent;
border-bottom: 0px solid transparent;
-webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);
box-shadow: inset 0 1px 0 rgba(255,255,255,.1),0 0px 0 rgba(255,255,255,.1);
}
}
<nav class="navbar navbar-inverse" role="navigation">
<div class="container-fluid">
<!-- add header -->
<div class="navbar-header">
<button type="button" class="navbar-toggle pull-left" data-toggle="collapse" data-target="#navbar1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- add search form -->
<form class="navbar-form navbar-right" role="search">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search this site">
<span class="input-group-btn">
<button type="submit" class="btn btn-default">
<span class="glyphicon glyphicon-search"></span>
</button>
</span>
</div>
</form>
</div>
<!-- add menu -->
<div class="collapse navbar-collapse" id="navbar1">
<ul class="nav navbar-nav" style="width:100%">
<li class="active">Home</li>
<li>About</li>
<li>Services</li>
</ul>
</div>
</div>
</nav>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
You will have to add another search form that will become visible on mobile devices. You can style it with your css to position the search bar properly.
Here is the updated html:
<div class="container-fluid">
<!-- add header -->
<div class="navbar-header">
<button type="button" class="navbar-toggle pull-left" data-toggle="collapse" data-target="#navbar1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- add the mobile devices search form here -->
<div class="col-xs-10 visible-xs">
<form class="navbar-form navbar-right mobile-search" role="search">
<div class="input-group">
<input class="form-control" placeholder="Search this site" type="text">
<span class="input-group-btn">
<button type="submit" class="btn btn-default">
<span class="glyphicon glyphicon-search"></span>
</button>
</span>
</div>
</form>
</div>
<!-- end of the mobile devices search form section -->
</div>
<!-- add menu -->
<div class="collapse navbar-collapse" id="navbar1">
<ul class="nav navbar-nav">
<li class="active">Home</li>
<li>About</li>
<li>Services</li>
</ul>
<!-- add search form -->
<form class="navbar-form navbar-right hidden-xs" role="search">
<div class="input-group">
<input class="form-control" placeholder="Search this site" type="text">
<span class="input-group-btn">
<button type="submit" class="btn btn-default">
<span class="glyphicon glyphicon-search"></span>
</button>
</span>
</div>
</form>
</div>
</div>
I have done some changes in default css file may this will help you.
<nav class="navbar navbar-inverse" role="navigation">
<div class="container-fluid">
<!-- add header -->
<div class="navbar-header pull-left">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<!-- add menu -->
<div class="collapse navbar-collapse" id="navbar1">
<ul class="nav navbar-nav">
<li class="active">Home</li>
<li>About</li>
<li>Services</li>
</ul>
<!-- add search form -->
</div>
<form class="navbar-form navbar-right pull-right" role="search">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search this site">
<span class="input-group-btn">
<button type="submit" class="btn btn-default">
<span class="glyphicon glyphicon-search"></span>
</button>
</span>
</div>
</form>
</div>
</nav>
CSS:
#media (min-width:768px){
.navbar-collapse{
float:left
}
}
#media (max-width:767px){
.navbar-form.navbar-right{
border-color: #101010;
width: calc(100% - 30px);
padding: 0;
border: none;
}
.navbar{
border:none;
}
.navbar-collapse{
background-color: #222;
position: absolute;
top: 50px;
width: 100%;
left:0;
margin:0 !important;
}
}
Here is working demo: https://jsfiddle.net/vb8ptav5/

bootstrap - navbar - exchange brand and toggle

I would like to switch the brand and the toggle button in mobile view if the viewport is small enough. On desktop viewport the brand icons shall be on the right side and the links shall be displayed normaly.
Examples:
Desktop:
+--------------------------------------------+
|Link1 Link2 BrandIcon1 BrandIcon2 |
+--------------------------------------------+
Mobile:
+----------------------------+
|[=] BrandIcon1 BrandIcon2 |
+----------------------------+
What is the easiest and cleanest way to code this?
Made a Pen: http://codepen.io/Kaito23/pen/Wxmxgm
#import url('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css');
.navbar-toggle {
float:left;
}
.navbar-brand {
float: right;
}
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-left">
<li class="active">Link <span class="sr-only">(current)</span></li>
<li>Link</li>
</ul>
<ul class="visible-xs visible-xs visible-sm visible-md visible-lg nav navbar-nav navbar-right">
<li><img src="http://images.fatcow.com/icons/32/wordpress.png" /></li>
<li><img src="http://www.wbdesignideas.com/images_drf_color.png" /></li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
Currently the problem is that when the icons are in the navbar-collapse class they disapear. If I put them under the collapse div, they are in a
new row.
Thanks in advance
Greetings
Kaito
Let's take Bootstrap's default navbar and remove unnecessary parts.
Then change floats to the opposite direction.
And add second brand before the first one. (It's because of the float: right; property.)
Please check the result: http://codepen.io/glebkema/pen/PzLbmz
#import url('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css');
#media (min-width: 768px) {
.navbar-header {
float: right;
}
}
.navbar-brand {
float: right;
}
.navbar-toggle {
float: left;
margin-left: 15px;
margin-right: 0;
}
<nav class="navbar navbar-default">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Brand 2</a>
<a class="navbar-brand" href="#">Brand 1</a>
</div>
<div class="collapse navbar-collapse" id="navbar-collapse-1">
<ul class="nav navbar-nav">
<li>Left 1</li>
<li>Left 2</li>
<li>Left 3</li>
</ul>
</div>
</div>
</nav>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>

navbar-toggle bootstrap content hidden by another div

I'm using the bootstrap navbar-toggle button and when I click on it, the content stays hidden by the next div, I'm trying to fix it but I can't see the error.
You will see I have two div.row. The second div.row is hidding the div id="navbar1" content, that is the target of the navbar-toggle button.
<div class="container-fluid">
<div class="row">
<nav class="navbar navbar-default" style="height:75px;">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar1">
<span class="sr-only">Menu</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<img src="zzlogo.png">
</div>
<div class="collapse navbar-collapse" id="navbar1">
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
Nosotros <span class="caret"></span>
<ul class="dropdown-menu">
<li>Desarrolladores</li>
<li>Trayectoria</li>
</ul>
</li>
<li class="dropdown">
Productos <span class="caret"></span>
<ul class="dropdown-menu">
<li>Abarrotes</li>
<li>Frutas y Verduras</li>
<li>Carnes</li>
<li>Lácteos</li>
</ul>
</li>
<li>Contacto</li>
</ul>
</div>
</div>
</nav>
</div>
<!-- THIS DIV IS NOT MOVING WHEN I CLICK ON THE NAVBAR-TOGGLE BUTTON -->
<div class="row">
<nav class="navbar navbar-inverse">
<div class="container">
<div class="navbar-header col-xs-5 col-sm-4 col-md-3 col-lg-3">
Administración
</div>
<div class="col-xs-7 col-sm-8 col-md-9 col-lg-9">
<ul class="nav navbar-nav">
<li >Usuarios</li>
<li >Productos</li>
</ul>
</div>
</div>
</nav>
</div>
</div>
Sorry for my bad english and thanks.
The problem is caused by declaring a height for the navbar (height: 75px). It's default is min-height: 50px so once the viewport is under 768px the navbar can't expand rendering the background as "invisible" if you will.
You can use padding to increase the height.
See working examples.
Example 1
.navbar.navbar-top {
padding-top: 20px;
padding-bottom: 20px;
margin-bottom: 0;
border-radius: 0;
}
.navbar.navbar-bottom {
border-radius: 0;
}
.navbar-top .navbar-brand {
padding-top: 0;
margin-top: -12px;
}
#media (max-width: 767px) {
.navbar-top .navbar-collapse {
margin-top: 20px;
margin-bottom: -20px;
}
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />
<nav class="navbar navbar-default navbar-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar1"> <span class="sr-only">Menu</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="#" class="navbar-brand">
<img src="http://placehold.it/150x75/f00">
</a>
</div>
<div class="collapse navbar-collapse" id="navbar1">
<ul class="nav navbar-nav navbar-right">
<li class="dropdown"> Nosotros <span class="caret"></span>
<ul class="dropdown-menu">
<li>Desarrolladores
</li>
<li>Trayectoria
</li>
</ul>
</li>
<li class="dropdown"> Productos <span class="caret"></span>
<ul class="dropdown-menu">
<li>Abarrotes
</li>
<li>Frutas y Verduras
</li>
<li>Carnes
</li>
<li>Lácteos
</li>
</ul>
</li>
<li>Contacto
</li>
</ul>
</div>
</div>
</nav>
<nav class="navbar navbar-inverse navbar-bottom">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar2"> <span class="sr-only">Menu</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button> Administración
</div>
<div class="collapse navbar-collapse" id="navbar2">
<ul class="nav navbar-nav">
<li>Usuarios
</li>
<li>Productos
</li>
</ul>
</div>
</div>
</nav>
Example 2
.navbar.navbar-top {
padding-top: 20px;
padding-bottom: 20px;
margin-bottom: 0;
border-radius: 0;
}
.navbar.navbar-bottom {
border-radius: 0;
}
.navbar.navbar-bottom a {
margin: 0 5px;
}
.navbar-top .navbar-brand {
padding-top: 0;
margin-top: -12px;
}
#media (max-width: 767px) {
.navbar-top .navbar-collapse {
margin-top: 20px;
margin-bottom: -20px;
}
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<nav class="navbar navbar-default navbar-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar1"> <span class="sr-only">Menu</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="#" class="navbar-brand">
<img src="http://placehold.it/150x75/f00">
</a>
</div>
<div class="collapse navbar-collapse" id="navbar1">
<ul class="nav navbar-nav navbar-right">
<li class="dropdown"> Nosotros <span class="caret"></span>
<ul class="dropdown-menu">
<li>Desarrolladores
</li>
<li>Trayectoria
</li>
</ul>
</li>
<li class="dropdown"> Productos <span class="caret"></span>
<ul class="dropdown-menu">
<li>Abarrotes
</li>
<li>Frutas y Verduras
</li>
<li>Carnes
</li>
<li>Lácteos
</li>
</ul>
</li>
<li>Contacto
</li>
</ul>
</div>
</div>
</nav>
<nav class="navbar navbar-inverse navbar-bottom">
<div class="container">
<div class="navbar-header"> Administración
<p class="navbar-text"> Usuarios Productos
</p>
</div>
</div>
</nav>

How to move the navigation bar to the top of the page

My navigation does not seem to want to move to the top of the page. this is how it currently looks like: http://i.stack.imgur.com/9kjc5.png
I tried to add margin-top: 0px, but it does not seem to work. I took the example from http://jsfiddle.net/jusuchyne/tupxwyqe/. Here's my html code:
<div class="row nav1">
<nav class="navbar navbar-inverse" id="top-menu" role="navigation">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-target="#navbarCollapse" data-toggle="collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<!-- Collapse navigation -->
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="nav navbar-nav">
<li class="active">HOME</li>
<li>MEN</li>
<li>WOMEN</li>
<li>KIDS</li>
<li>ACCESSORIES</li>
<li>FOOTWEAR</li>
<li>COSMETICS</li>
<li>YOUR ACCOUNT</li>
</ul>
<!-- Search box -->
<form class="navbar-form navbar-right">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search" name="srch-term" id="srch-term">
<div class="input-group-btn">
<button class="btn btn-info" type="submit">
<i class="glyphicon glyphicon-search"></i>
</button>
</div>
</div>
</form>
</div>
</div>
<!-- End container-fluid -->
</nav>
<!-- End navbar-inverse -->
</div>
And here's the css:
.navbar {
margin: 15px;
font-family: 'Raleway', sans-serif;
background: #444444;
}
.navbar-inverse .navbar-nav > .active > a {
background: #000000;
}
.navbar-inverse .navbar-nav > li > a {
color: #F2DEDE;
}
#move_to_top {
top: 0px;
}
.navbar.navbar-inverse {
font-family: 'Raleway', sans-serif;
background: #444444;
}
.navbar.navbar-inverse .navbar-nav>.active>a {
background: #000000;
}
.navbar.navbar-inverse .navbar-nav > li > a {
color: #F2DEDE;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />
<link href='http://fonts.googleapis.com/css?family=Raleway' rel='stylesheet' type='text/css'>
<div class="nav1">
<nav class="navbar navbar-inverse navbar-static-top" id="top-menu" role="navigation">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-target="#navbarCollapse" data-toggle="collapse"> <span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<!-- Collapse navigation -->
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="nav navbar-nav">
<li class="active"> HOME
</li>
<li> MEN
</li>
<li> WOMEN
</li>
<li> KIDS
</li>
<li> ACCESSORIES
</li>
<li> FOOTWEAR
</li>
<li> COSMETICS
</li>
<li> YOUR ACCOUNT
</li>
<!-- <li class="dropdown">
More<b class="caret"></b>
<ul class="dropdown-menu">
<li>
Example1
</li>
</ul>
</li>
-->
</ul>
<!-- Search box -->
<form class="navbar-form navbar-right">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search" name="srch-term" id="srch-term">
<div class="input-group-btn">
<button class="btn btn-info" type="submit"> <i class="glyphicon glyphicon-search"></i>
</button>
</div>
</div>
</form>
</div>
</div>
<!-- End container-fluid -->
</nav>
<!-- End navbar-inverse -->
</div>
Remove .row from your first line. It's completely unnecessary. See the docs and the margin you've added of 15px.

navbar not 100% width when browser is resized bootstrap 3.5

I have a navbar in which the width does not fit 100% when the browser is resized less than 760px
<nav class="navbar navbar-inverse navbar-static-top" style="margin-bottom:0;">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header page-scroll">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">
<img src="#">
</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="navbar-collapse collapse" id="bs-example-navbar-collapse-1" style="height: 1px;">
<ul class="nav navbar-nav navbar-left">
<li class="hidden"></li>
<li class="divider-vertical"></li>
<li>Home</li>
<li class="divider-vertical"></li>
<li>Login</li>
<li class="divider-vertical"></li>
<li>Signup</li>
<li class="divider-vertical"></li>
<li>
<form action="#">
Request
</form>
</li>
<li class="divider-vertical"></li>
<li><a target="_blank" href="#"></a></li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
</nav>
Here are some custom css i used
#media (min-width: 760px) {
.container {
padding-left: 20px;
padding-right: 20px;
width: auto
}
}
Add this CSS:
#media (max-width: 760px){
.container {
width: 100%;
}
}
.container-fluid>.navbar-collapse, .container-fluid>.navbar-header, .container>.navbar-collapse, .container>.navbar-header {
margin-right: 0;
margin-left: 0;
}
Here is a fiddle for it https://jsfiddle.net/u27r6dL2/3/