Show a form on a line following the collapsed navbar - html

Here is my current code: https://www.bootply.com/EJSJ6aQh6Q
<div class="row">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span>...</span>
</button>
<a class="navbar-brand">Brand</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Bar<span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a>A</a></li>
</ul>
</li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Foo<span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a>A</a></li>
</ul>
</li>
<li>
<a>Subscribe</a> </li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a id="registerLink">Register</a></li>
<li><a id="loginLink">Sign In</a></li>
</ul>
<form class="nav navbar-form navbar-right col-md-6" id="autocompleteSearchForm" method="get" role="search">
<div class="input-group input-group-circle input-group-sm" role="search" id="searchGroup">
<span><div class="tt-menu" style="position: absolute; top: 100%; left: 0px; z-index: 100; display: none;"><div class="tt-dataset tt-dataset-songs"></div></div></span>
<span class="input-group-btn">
<button class="btn btn-default" type="submit"><i class="fa fa-search text-success"></i></button>
</span>
</div>
</form>
</div>
</div>
Currently, when collapsed, the search bar falls under the collapsed section. I would like the search bar to be outside of the collapsed section, but not on the same line as the navbar-brand and collapse button. If I move the form inside the navbar-header div, it accomplishes what I want, but the margins are all messed up because bootstrap still thinks the search bar is on the same line as the other items.
Is there a way to do this better, or will I just have to move it to the navbar-header and fix the formatting issues that pop up?

Is this what you looking for ? It is still a rough fix using css. I have interchanged the position of form block along with a css fix. Other responsive tweek can be made for other screen devices.
https://www.bootply.com/pGDMXu2Q2R#
HTML:
<div class="row">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span>...</span>
</button>
<a class="navbar-brand">Brand</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Bar<span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a>A</a></li>
</ul>
</li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Foo<span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a>A</a></li>
</ul>
</li>
<li>
<a>Subscribe</a> </li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a id="registerLink">Register</a></li>
<li><a id="loginLink">Sign In</a></li>
</ul>
</div>
<form class="nav navbar-form navbar-right col-md-6" id="autocompleteSearchForm" method="get" role="search">
<div class="input-group input-group-circle input-group-sm" role="search" id="searchGroup">
<span class="twitter-typeahead" style="position: relative; display: inline-block;"><input autocomplete="off" class="form-control typeahead-search tt-hint" type="text" value="" readonly="" spellcheck="false" tabindex="-1" dir="ltr" style="position: absolute; top: 0px; left: 0px; border-color: transparent; box-shadow: none; opacity: 1; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(255, 255, 255);"><input autocomplete="off" class="form-control typeahead-search tt-input" id="home-search" name="searchString" placeholder="Search..." type="text" value="" spellcheck="false" dir="auto" style="position: relative; vertical-align: top; background-color: transparent;"><pre aria-hidden="true" style="position: absolute; visibility: hidden; white-space: pre; font-family: "Open Sans", Optima, Segoe, "Segoe UI", Candara, Calibri, Arial, sans-serif; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; word-spacing: 0px; letter-spacing: 0px; text-indent: 0px; text-rendering: auto; text-transform: none;"></pre><div class="tt-menu" style="position: absolute; top: 100%; left: 0px; z-index: 100; display: none;"><div class="tt-dataset tt-dataset-songs"></div></div></span>
<span class="input-group-btn">
<button class="btn btn-default" type="submit"><i class="fa fa-search text-success"></i></button>
</span>
</div>
</form>
</div>
CSS:
/* CSS used here will be applied after bootstrap.css */
#media (min-width:768px) {
.navbar-form{
position: absolute;
right: 135px;
top: 0;
}
}
#media (max-width:767px){
.twitter-typeahead{
display:block !important;
}
}

Related

Mobile responsive dropdown not moving content properly?

I used bootstrap header,when it collapse changed to dropdown it moves the below content down, the image moves properly but the text on the image not moving down properly
Image moves down on dropdown but the text remains constant,i need to overlay or move the content down
my html code is:
<nav class="navbar navbar-inverse">
<div class="container-fluid" id="container">
<div class="navbar-header" >
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar" style="background: black !important;"></span>
<span class="icon-bar" style="background: black !important;"></span>
<span class="icon-bar" style="background: black !important;"></span>
</button>
<img src="./assets/logo.png" class="logo" >
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li>About</li>
<li class="dropdown">
<a class="dropdown-toggle head-link" data-toggle="dropdown" href="#">Academic <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a class="head-link" href="#">Page 1-1</a></li>
<li><a class="head-link" href="#">Page 1-2</a></li>
<li><a class="head-link" href="#">Page 1-3</a></li>
</ul>
</li>
<li><a class="head-link" href="#">Locations</a></li>
<li><a class="head-link" href="#">Solutions</a></li>
<li><a class="head-link" href="#">Resources</a></li>
<button class="sigin-btn">Signup</button>
</ul>
</div>
</div>
</nav>
<div class="container">
<img src="./assets/Banner.jpg" class="banner">
<span class="cont-line1">Out of focus-</span>
<span class="cont-line2">Achieve with us</span>
</div>
Put this custom css on you .dropdown-item
If u already have some properties , You can manage it
.dropdown-item {
display: block;
max-width: 100%;
padding:0;
clear: both;
font-weight: 400;
color: #212529;
text-align: inherit;
white-space: nowrap;
background-color: transparent;
border: 0;
}
And Add this css on your css file
.navbar-collapse {
max-height: calc(100vh - 60px);
overflow-y: auto;
}
Then it will be fine ...
Hope this works for you

Excluding search bar from Bootstrap's navbar collapse

I know this question has already been asked here:
Bootstrap navbar search outside collapse.
Keeping my search bar viewable when my navbar collapses with twitter bootstrap
But mine is different in the sense that my search bar is located in the middle of other nav items, and I want all these other nav items to collapse except my search bar. I wasted a week trying to fix this, but every move I make creates a mess.
This is how my navbar looks:
https://postimg.org/image/7x623zbdi3/
HTML:
<div class="container" id="responsiveContainer">
<!-- Title -->
<div class="navbar-header pull-left">
<a class="navbar-brand" href="{% url 'index' %}"> abc </a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right" id="nav">
<li id="nav-form">
<form class="navbar-form">
<div class="form-group">
<input type="text" id="searchBox" class="form-control">
<button id="search" type="submit" class="btn btn-default"><span> <i class="fa fa-search"></i> </span></button>
</div>
</form>
</li>
<li class="dropdown">
Sign In/Up <b class="caret"></b>
<ul class="dropdown-menu" class="dropdownMenu">
<li> Sign Up </li>
<li> Sign In </li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-left" id="nav">
<li> Article </li>
<li> Contact </li>
</ul>
</div>
</div>
</nav>
Custom CSS:
#nav-form {
margin-right: -30px;
}
#nav input {
background-color: #D3212D;
color: white;
border: 1px solid #E32636;
}
#nav button {
background-color: #D3212D;
color: white;
border-radius: 60px;
border: 1px solid maroon;
box-shadow: 0px 0px 1px black;
font-family: FontAwesome;
font-size: 16px;
}
#nav button:hover {
background-color: #cd1b27;
box-shadow: 0px 0px 5px black;
}
input#search, select.form-control {
background: transparent;
border: none;
border-bottom: 1px solid #000000;
box-shadow: 0px 0px 5px orange;
}
#navbarToggle {
background-color: #E32636;
margin-top: 0px;
border: 1px solid #E32636;
}
#navbarToggle:hover, #navbarToggle:focus {
text-shadow: 0px 0px 1px rgb(32,42,62);
background-color: #E32636;
}
One of those articles you referenced does it here.
The person took the
< form... /form>
section and put it in it's own div. The key is to keep it out of the class="collapse navbar-collapse"
After a lot of debugging I finally found the solution and here it is:
HTML:
<!-- Navigational Bar -->
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse" id="navbarToggle">
<span class="sr-only">Toggle navigation</span>
<span><i class="fa fa-list fa-2x"></i></span>
</button>
<div class="container" id="responsiveContainer">
<!-- Title -->
<div class="navbar-header pull-left">
<a class="navbar-brand" href="{% url 'index' %}"><img id="navbar-logo" src="/static/media/Images/ditookcolored.png"></a>
</div>
<div class="navbar-header pull-right">
<!-- <button class="btn btn-default" id="mobileSearch"><i class="fa fa-search"></i></button> -->
<ul class="nav navbar-nav navbar-right" id="nav">
<li id="nav-form">
<form class="navbar-form navbar-center" id="navbarForm">
<div class="form-group">
<input type="text" placeholder="Search Ditook" id="searchBox" class="form-control">
<button id="search" type="submit" class="btn btn-default"><span> <i class="fa fa-search"></i> </span></button>
</div>
</form>
</li>
</ul>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right" id="nav">
<!-- <li id="nav-form">
<form id="navbarForm">
<div class="form-group">
<input type="text" placeholder="Search Ditook" id="searchBox" class="form-control">
<button id="search" type="submit" class="btn btn-default"><span> <i class="fa fa-search"></i> </span></button>
</div>
</form>
</li> -->
<li class="dropdown">
<i class="fa fa-arrow-circle-down"></i> Sign In/Up
<ul class="dropdown-menu">
<li><i class="fa fa-user-plus"></i> Sign Up </li>
<li><i class="fa fa-sign-in"></i> Sign In </li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-left" id="nav">
<li><i class="fa fa-list-alt"></i> Article </li>
<li><i class="fa fa-phone"></i> Contact </li>
</ul>
</div>
</div>
</nav>
This actually fixed my problem:
Custom CSS:
#nav input {
position: static;
margin-left: -400px;
}
#nav button {
position: static;
margin-left: -1px;
height: 35px;
}

.btn-group hamburger menu issues and confusion

I'm creating a responsive website, and I'm relatively new to bootstrap. I'm trying to create a responsive navigation that turns into a hamburger menu at less than 1340px. I'm using a split button setup right now, see https://jsfiddle.net/ethacker/u38scspb/, it doesn't really work well, it turns into a scrollable thing. I'd like the dropdown to look something like this on less than 1340px screens.
I'm trying to add the navbar classes (see https://jsfiddle.net/ethacker/d306gphq/1/). When I do this, the navbar hamburger icon doesn't show anymore.
So my questions are :
1. How do I make the hamburger menu icon show?
2. Am I doing this the right way, or is there an easier way?
3. How do I make it look like the above image when viewed on mobile devices/smaller than 1340px screens?
4. How do I trigger the hamburger button at less than 1340px instead of just on mobile?
I'm trying to learn, but I'm just not sure which direction to head in.
My CSS code:
body {
background-image: url('backgroundarrows.png');
}
body > div.container-fluid > header {
background-color: #e9e7ff;
margin-top: 0;
text-align: center;
}
.inline-display {
display: inline;
}
.float-right {
float: right;
}
#logo {
height: 90px;
width: 170px;
}
#search {
margin-right: 1%;
}
.container-fluid {
padding: 0;
}
.content {
padding: 1%;
background-color: #f9fdff;
border: solid thin lightgray;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
margin: 0 1%;
}
section.content {
width: 60%;
}
aside.content {
width: 30%;
text-align: center;
}
.btn {
color: rgb(181,181,225);
}
#my-btn-group{
margin-left: 1%;
}
.mybtngroup {
border-right: solid thin rgb(181,181,225);
border-left: solid thin rgb(181,181,225);
}
.mybtngroup > a.btn.divider {
border-right: solid thin rgb(181,181,225);
}
.heading, div.quip{
font-family: "Monotype Corsiva", cursive;
text-align: center;
}
div.quip, aside > h2.heading{
border-bottom: thin solid grey;
}
div.quip {
font-size: 16px;
}
a{
color: rgb(165, 165, 205);
text-decoration: none;
}
#blogposts {
margin-top: -5%;
}
My HTML:
<div class="container-fluid">
<header class="page-header">
<!-- logo -->
<h1 class="inline-display"><img id="logo" src="mommyinfologo.png"/></h1>
<br/>
<div class="btn-group" id="my-btn-group">
<!-- Home Group -->
<div class="btn-group mybtngroup">
<a class="btn" href="index.php">Home</a>
<a class="btn dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</a>
<ul class="dropdown-menu mylist">
<li>This Mommy's Madness</li>
<li>About Mommy Info</li>
<li>Contact Mommy Info</li>
</ul>
</div>
<!-- Pregnancy group-->
<div class="btn-group mybtngroup">
<a class="btn" href="/pregnancy">Pregnancy</a>
<a class="btn dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</a>
<ul class="dropdown-menu mylist">
<li>Trying to Conceive</li>
<li>Fetal Development</li>
<li>Gender Predictions</li>
<li>Labor and Delivery</li>
</ul>
</div>
<!-- All About Baby group-->
<div class="btn-group mybtngroup">
<a class="btn" href="/all-about-baby">All About Baby</a>
<a class="btn dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</a>
<ul class="dropdown-menu mylist">
<li>Advice</li>
<li>Guidelines</li>
<li>Milestones</li>
<li>Learning Development</li>
</ul>
</div>
<!-- Health and Nutrition group-->
<div class="btn-group mybtngroup">
<a class="btn" href="/health-and-nutrition">Health and Nutrition</a>
<a class="btn dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</a>
<ul class="dropdown-menu mylist">
<li>Pregnancy Nutrition</li>
<li>Breastfeeding</li>
<li>Formula Feeding</li>
<li>Toddler Nutrition</li>
<li>Prenatal Exercise</li>
<li>Postpartum Exercise</li>
<li>Organic DIY Health</li>
</ul>
</div>
<!-- Party Momma group-->
<div class="btn-group mybtngroup">
<a class="btn" href="/party-momma">Party Momma</a>
<a class="btn dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</a>
<ul class="dropdown-menu mylist">
<li>Pregnancy Announcement</li>
<li>Gender Reveal</li>
<li>Baby Shower</li>
<li>Birth Announcement</li>
<li>Birthdays</li>
</ul>
</div>
<!-- Stations group-->
<div class="btn-group mybtngroup">
<a class="btn" href="/stations">Stations</a>
<a class="btn dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</a>
<ul class="dropdown-menu mylist">
<li>Hospital Bag</li>
<li>Diaper Bag</li>
<li>Changing Station</li>
<li>Baby Gear</li>
</ul>
</div>
<!-- Memory Markers group-->
<div class="btn-group mybtngroup">
<a class="btn" href="/memory-markers">Memory Markers</a>
<a class="btn dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</a>
<ul class="dropdown-menu mylist">
<li>Do It Yourself</li>
<li>Buy It</li>
</ul>
</div>
<!-- Reviews group-->
<div class="btn-group mybtngroup">
<a class="btn mycaret" href="/reviews">Reviews</a>
<a class="btn dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</a>
<ul class="dropdown-menu mylist">
<li>Game Reviews</li>
<li>Gear Reviews</li>
<li>Learning Reviews</li>
</ul>
</div>
<!-- Blog-->
<a class="btn mybtngroup" id="blog" href="/mommy-madness">
Blog
</a>
</div> <!-- closing div#btn-group-justified -->
<input class="float-right" type="text" name="search" id="search" placeholder="Search"/>
This is the code from Bootstrap that makes the navbar collapse when using a tablet or a mobile phone.
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="active">Link <span class="sr-only">(current)</span></li>
<li>Link</li>
<li class="dropdown">
Dropdown <span class="caret"></span>
<ul class="dropdown-menu">
<li>Action</li>
<li>Another action</li>
<li>Something else here</li>
<li role="separator" class="divider"></li>
<li>Separated link</li>
<li role="separator" class="divider"></li>
<li>One more separated link</li>
</ul>
</li>
</ul>
You can read about it more here: http://getbootstrap.com/components/#navbar
You need to include #media query selector into your main.css for the elements to change on specific screen width. For example:
#media (min-width: 768px) {
p { color: red; }
}

Bootstrap navbar is not responsive

I have coded up a bootstrap navbar, however when I tried to test its responsiveness, it does not create the little hamburger icon like it should...
I have an outer container for my page which has a fixed width, and an inner container for my fixed-top navbar of course. I have tried playing around with the containers, but it doesnt make the navbar responsive at all, so I must be missing something, or some code is conflicting with the responsive navbar??
fyi: the flex code doesnt seem to be working correctly in here :/
thanks guys
body {
padding-top: 102px;
background-color: #4d4d4d;
}
.container {
width: 1530px;
margin: 0 auto;
margin-top: 0;
}
.navbar-brand {
font-size: 50px;
padding-top: 40px;
}
.custom-nav {
min-height: 90px;
font-size: 16px;
color: #000 !important;
background-color: #fff;
}
.dropdown-menu.user-list {
width: 100%;
border-radius: 0;
box-shadow: none;
border: 0;
background-color: #F8F8F8;
font-size: 15px;
}
ul.user-list li a {
padding: 8px 30px;
}
ul.user-list li.divider {
width: 200px;
margin: 0 auto;
}
.avatar-img {
padding: 0;
}
i.fa-angle-down {
font-size: 25px;
vertical-align: middle;
font-weight: lighter;
}
/* My styles */
li.dropdown {
height: 90px;
display: flex;
justify-content: center;
align-items: center;
position: relative;
}
.user {
margin-left: 50px;
margin-right: 20px;
}
.label {
border-radius: 100px;
position: absolute;
top: 25px;
right: 2px;
background-color: #ff5500;
}
.navbar-default .navbar-nav>li>a {
color: #777;
padding: 30px 19px;
}
li.dropdown.bell {
margin-right: 40px;
}
.nav>li.dropdown.bell>a:hover,
.nav>li.dropdown.bell>a:focus {
background-color: transparent;
}
#search-container {
width: 300px;
}
<link href='https://fonts.googleapis.com/css?family=Lato' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.2/js/bootstrap.min.js"></script>
<div class="container">
<nav class="navbar navbar-default navbar-fixed-top custom-nav">
<div class="container">
<a class="navbar-brand navbar-left" href="#">PAGE NAME</a>
<ul class="nav navbar-nav navbar-right">
</ul>
<ul class="nav navbar-nav navbar-right">
<!-- search bar added -->
<li class="dropdown">
<div class="input-group" id="search-container">
<input type="text" class="form-control" placeholder="Recipient's username" aria-describedby="basic-addon2">
<span class="input-group-addon" id="basic-addon2"><span class="glyphicon glyphicon-search"></span></span>
</div>
</li>
<li class="dropdown bell">
<a href="#" class="dropdown-toggle inbox" data-toggle="dropdown">
<img src="http://placehold.it/50x50" class=" avatar-img img-square">
<span class="label label-info">1</span>
</a>
<ul class="dropdown-menu bell" role="menu">
<li><span class="label label-warning">4:00 AM</span>Favourites Snippet
</li>
<li><span class="label label-warning">4:30 AM</span>Email marketing
</li>
<li><a href="#"><span class="label label-warning">5:00 AM</span>Subscriber focused email
design</a>
</li>
<li class="divider"></li>
<li>View All
</li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<img src="http://placehold.it/70x70" class=" avatar-img img-circle"><span class="user">Jacky Smith</span><i class="fa fa-angle-down"></i>
<!-- <span class="glyphicon glyphicon-menu-down"></span> -->
</a>
<ul id="menu" class="dropdown-menu user-list" role="menu">
<li>Action
</li>
<li class="divider"></li>
<li>Another action
</li>
<li class="divider"></li>
<li>Something else here
</li>
<li class="divider"></li>
<li>Separated link
</li>
<li class="divider"></li>
<li>One more separated link
</li>
</ul>
</li>
</ul>
</div>
</nav>
<div class="container">
<div class="row">
<div class="col-md-12">
<p>dfsjfhskfs</p>
<!-- <div class="chevron right">
</div>
<div style="height: 1em;">
</div> -->
</div>
</div>
</div>
</div>
You have a few issues that you need to fix.
You need a navbar-header, that includes the button that will be shown on small screen sizes.
<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 navbar-left" href="#">PAGE NAME</a>
</div>
You need to wrap your menu content in a collapse div, that will be shown/hidden on button click on small screen sizes.
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
3. The container inside of your menu needs to be a container-fluid.
<nav class="navbar navbar-default navbar-fixed-top custom-nav">
<div class="container-fluid">
You need to make your container class have auto width for small screen sizes, otherwise it pushes the hamburger button off the screen. A bit of CSS with a media query can achieve this.
#media(max-width: 767px) {
.container {
width: auto;
}
}
Bootstrap Navbar Documentation
body {
padding-top: 102px;
background-color: #4d4d4d;
}
.container {
width: 1530px;
margin: 0 auto;
margin-top: 0;
}
#media(max-width: 767px) {
.container {
width: auto;
}
}
.navbar-brand {
font-size: 50px;
padding-top: 40px;
}
.custom-nav {
min-height: 90px;
font-size: 16px;
color: #000 !important;
background-color: #fff;
}
.dropdown-menu.user-list {
width: 100%;
border-radius: 0;
box-shadow: none;
border: 0;
background-color: #F8F8F8;
font-size: 15px;
}
ul.user-list li a {
padding: 8px 30px;
}
ul.user-list li.divider {
width: 200px;
margin: 0 auto;
}
.avatar-img {
padding: 0;
}
i.fa-angle-down {
font-size: 25px;
vertical-align: middle;
font-weight: lighter;
}
/* My styles */
li.dropdown {
height: 90px;
display: flex;
justify-content: center;
align-items: center;
position: relative;
}
.user {
margin-left: 50px;
margin-right: 20px;
}
.label {
border-radius: 100px;
position: absolute;
top: 25px;
right: 2px;
background-color: #ff5500;
}
.navbar-default .navbar-nav>li>a {
color: #777;
padding: 30px 19px;
}
li.dropdown.bell {
margin-right: 40px;
}
.nav>li.dropdown.bell>a:hover,
.nav>li.dropdown.bell>a:focus {
background-color: transparent;
}
#search-container {
width: 300px;
}
<link href='https://fonts.googleapis.com/css?family=Lato' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.2/js/bootstrap.min.js"></script>
<div class="container">
<nav class="navbar navbar-default navbar-fixed-top custom-nav">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<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 navbar-left" href="#">PAGE NAME</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
</ul>
<ul class="nav navbar-nav navbar-right">
<!-- search bar added -->
<li class="dropdown">
<div class="input-group" id="search-container">
<input type="text" class="form-control" placeholder="Recipient's username" aria-describedby="basic-addon2">
<span class="input-group-addon" id="basic-addon2"><span class="glyphicon glyphicon-search"></span></span>
</div>
</li>
<li class="dropdown bell">
<a href="#" class="dropdown-toggle inbox" data-toggle="dropdown">
<img src="http://placehold.it/50x50" class=" avatar-img img-square">
<span class="label label-info">1</span>
</a>
<ul class="dropdown-menu bell" role="menu">
<li><span class="label label-warning">4:00 AM</span>Favourites Snippet
</li>
<li><span class="label label-warning">4:30 AM</span>Email marketing
</li>
<li><a href="#"><span class="label label-warning">5:00 AM</span>Subscriber focused email
design</a>
</li>
<li class="divider"></li>
<li>View All
</li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<img src="http://placehold.it/70x70" class=" avatar-img img-circle"><span class="user">Jacky Smith</span><i class="fa fa-angle-down"></i>
<!-- <span class="glyphicon glyphicon-menu-down"></span> -->
</a>
<ul id="menu" class="dropdown-menu user-list" role="menu">
<li>Action
</li>
<li class="divider"></li>
<li>Another action
</li>
<li class="divider"></li>
<li>Something else here
</li>
<li class="divider"></li>
<li>Separated link
</li>
<li class="divider"></li>
<li>One more separated link
</li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<div class="container">
<div class="row">
<div class="col-md-12">
<p>dfsjfhskfs</p>
<!-- <div class="chevron right">
</div>
<div style="height: 1em;">
</div> -->
</div>
</div>
</div>
</div>

twitter bootstrap IE9, nav collapse not pushing rest of content down

Im not sure is this an issue with the content below it, or nav-collapse itself, But the only way I can seem to replicate the issue in firefox is by changing float:left to float:none in the code below. Basically when I toggle the menu the content below it doesnt get pushed down in IE9
.navbar .navbar-inner .nav-collapse.collapse
{
background: #6E2E8F;
border-radius: 5px 5px 5px 5px;
float: left;
height: 0px;
margin-bottom: 15px;
padding: 0;
width: 100%;
}
.navbar {overflow: visible;}
Here is the outputted html...
<div class="navbar">
<div class="navbar-inner">
<a data-target=".nav-collapse" data-toggle="collapse" class="brand visible-phone"> Categories</a>
<a data-target=".nav-collapse" data-toggle="collapse" class="btn btn-navbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<div class="nav-collapse collapse">
<ul class="nav">
<li>***CONTENT***</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<span>Start Shopping
</span><span class="active_downarrow"></span></a>
<span class="sub-menu-response">
<ul class="dropdown-menu" > ***CONTENT*** </ul>
<ul class="dropdown-menu" > ***CONTENT*** </ul>
<ul class="dropdown-menu" > ***CONTENT*** </ul>
<ul class="dropdown-menu" > ***CONTENT*** </ul>
<ul class="dropdown-menu" > ***CONTENT*** </ul>
</span>
</li>
<li> ***CONTENT*** </li>
<li> ***CONTENT*** </li>
<li>***CONTENT*** </li>
</ul>
</div>
</div>
</div>
Here is the link to the site... http://bc_mobile.hailstormcommerce.com/
You can try adding this css class:
.nav-collapse.collapse.in {
height: auto !important;
}
Because when you drop-down the navigation, bootstrap gives it an initial width fixed.