Bootstrap navbar with permanent right aligned icons - html

Hi I'm having an issue creating a bootstrap (v3.3.4) navbar that includes non-collapsible right aligned icons. The correct solution should have the "Brand", then a home button, then the collapsible left-aligned menu and finally right aligned icons which are never collapsed.
I have an example which I've been working on and which is close to the required output:
http://codepen.io/danhalligan/pen/qdLVPe/
However, the right aligned "envelope" icon moves when the right aligned dropdown menu is clicked (when the page is narrow and the left aligned links are collapsed).
This question is related to but not the same as some others (on which this mockup is partially based):
Icons on the right side of the bootstrap navbar
Twitter Bootstrap 3.3.4: navbar with right aligned dropdown menu always visible / usable
Any help much appreciated. Code pasted below as requested by stack overflow
HTML:
<nav class="navbar navbar-default navbar-static">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<a class="navbar-brand" href="#">Brand</a>
<ul class="nav mynav pull-left">
<li>
<a title="Homepage" href="#"><i class="glyphicon glyphicon-home"></i></a>
</li>
</ul>
<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>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-left" 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" role="menu">
<li>Action</li>
<li>Another action</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>
<!-- /.navbar-collapse -->
<ul class="nav navbar-nav navbar-right mobileNav pull-right">
<li class="dropdown">
<a title="email" href="#"><span class="glyphicon glyphicon-envelope"></span></a>
</li>
<li class="dropdown">
<span class="glyphicon glyphicon-download-alt"></span><span class="caret"></span>
<ul class="dropdown-menu" role="menu">
<li>Action</li>
<li>Another action</li>
<li>Something else here</li>
<li class="divider"></li>
<li>Separated link</li>
</ul>
</li>
</ul>
</div>
<!-- /.container-fluid -->
</nav>
CSS:
.mynav.pull-left > li > a {
color: #777;
padding-top: 15px;
padding-bottom: 15px;
}
.mobileNav {
position: absolute;
right: 20px;
top: 0px;
}
.mobileNav > li {
display: inline-block;
vertical-align: text-top;
float: left;
}
.navbar-right ul.dropdown-menu {
text-align: right;
}
#media only screen and (max-width: 768px) {
.mobileNav {
text-align: right;
}
.navbar-nav .open .dropdown-menu {
border: 1px solid #ccc;
margin-top: 2px;
background: white;
box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
-webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
}
.navbar-default .navbar-nav>.open>a,
.navbar-default .navbar-nav>.open>a:hover,
.navbar-default .navbar-nav>.open>a:active,
.navbar-default .navbar-nav>.open>a:focus {
background: none;
}
}
.navbar-toggle {
float: left
}
.navbar-inverse {
background-color: #337ab7;
border-color: #337ab7;
}
.navbar-inverse .navbar-brand {
color: #ffffff;
white-space: nowrap;
}

Add this to your CSS:
#media (max-width: 767px) {
.navbar-nav .open .dropdown-menu {
position: absolute;
left: auto;
right: 0;
}
}
The current setting is position: static (Bootstrap default) and left/right are not set.
Edit: Here is the preview. The change is after line 34 inside the CSS box.

This css uses a flex box and works well for me. I generated it at http://the-echoplex.net/flexyboxes/
.dropdown-menu > li
{
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-flex-wrap: nowrap;
-ms-flex-wrap: nowrap;
flex-wrap: nowrap;
-webkit-justify-content: space-between;
-ms-flex-pack: justify;
justify-content: space-between;
-webkit-align-content: space-around;
-ms-flex-line-pack: distribute;
align-content: space-around;
-webkit-align-items: flex-start;
-ms-flex-align: start;
align-items: flex-start;
}

Related

how to change color of links in dropdown menu in navbar toggle

My navigation bar has a dropdown menu that looks like this.
when I resize my browser to get the small device version it looks like this.
I want to change the color of links in the dropdown(services) to black but I don't know which class to select for CSS.
I tried this but didn't work out.
.dropdown-menu {
display: none;
position: absolute;
background-color: #00ff99;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-menu > li > a {
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.navbar-toggle .dropdown-menu > li > a{
color: black;
}
this is my HTML
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
#Html.ActionLink("E-HealthCare", "About", "Home", new { area = "" }, new { #class = "navbar-brand shadow" })
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>#Html.ActionLink("Home", "About", "Home")</li>
#*
<li>#Html.ActionLink("About", "About", "Home")</li>
<li>#Html.ActionLink("Contact", "Contact", "Home")</li>
<li>#Html.DropDownList("Services","ALL")</li>
*#
<li>
<div class="dropdown">
<button class="Dropdown-btn btn-block text-left dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-expanded="false">
Services
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
<li>Action</li>
<li>Another action</li>
<li>Something else here</li>
<li role="separator" class="divider"></li>
<li>Separated link</li>
</ul>
</div>
</li>
</ul>
Try this if this works.
ul.dropdown-menu > li > a {color:black !important;}
I think you need to go futher more with this. Because the one you need to go to is .dropdown-menu > li > a > li > ul which is in my opinion is too heavy. Try add this one to your code
#dropdown {
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}

navbar overflows (x) page content

I have created a website using Bootstrap 3. When in responsive mode, my index.html page has a horizontal scroll bar. I could not find what is causing this overflow-x. This only happens in my index.html page.
In the other pages, this overflow is not present. At first I thought it was something in the Contact section of my index.html which has a box shadow which caused the overflow in x. Even after removing it, the overflow was present which made me conclude that the navbar is the one causing the issue.
I am not able to find what is causing this issue.
Screenshot: (the overflow on the right side)
HTML code for navbar:
<header id="main">
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#collapse" 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="">
<!-- <img class="img img-responsive" src="www/images/srs-logo.jpg" alt="SRS Constructions"> -->
SRS Constructions
</a>
</div>
<div class="collapse navbar-collapse navbar-right" id="collapse">
<ul class="nav navbar-nav">
<li class="active"><a class="main" href="#main">Home <span class="sr-only">(current)</span></a>
</li>
<li class="dropdown" id="nav-about">
<a href="#about" class="dropdown-toggle main" role="button" aria-haspopup="true" aria-expanded="false">About
</a>
<ul class="dropdown-menu" style="left:0;right: auto">
<li>The Founder</li>
<li role="separator" class="divider"></li>
<li>HSE Policy</li>
<li>Quality Policy</li>
</ul>
</li>
<li><a class="main" href="#services">Services</a></li>
<li><a class="main" href="#projects">Our Projects</a></li>
<li><a class="main" href="#whyus">Why Us</a></li>
<li><a class="main" href="#contact">Contact</a></li>
</ul>
</div>
</div>
</nav>
</header>
I have not added any specific css which alters the width of the navbar.
CSS for navbar:
/*Navbar styles*/
.navbar {
box-shadow: 0 3px 3px rgba(0, 0, 0, 0.3);
}
.navbar-default .navbar-nav {
font-size: 15px;
}
.navbar-fixed-top {
min-height: 80px;
}
.navbar-nav > li > a {
padding-top: 0px;
padding-bottom: 0px;
line-height: 80px;
}
.dropdown-menu > .active > a,
.dropdown-menu > .active > a:hover,
.dropdown-menu > .active > a:focus {
color: #ffffff;
text-decoration: none;
outline: 0;
background-color: #b4a28f;
}
#media (max-width: 767px) {
.navbar-nav > li > a {
line-height: 30px;
padding-top: 10px;
padding-bottom: 10px;
}
.navbar-brand > img {
width: 40%;
position: relative;
display: inline-block;
height: auto;
margin-left: 90px;
margin-top: -80px;
}
#footer {
color: #2e2e2e;
}
}
#media (min-width: 767px) {
#footer {
color: #ffffff;
}
}
.navbar-brand > img {
width: 30%;
position: relative;
display: inline-block;
height: auto;
margin-left: 50px;
margin-top: -15px;
}
The site is also available here
Please help me with fixing this issue.
Make sure you follow the "rules" for the grid...
Columns .col-* must be wrapped in .row, and only .col-* should be the immediate child of a .row
.row > .gallery in the projects section is causing the scrollbar since .gallery is not a column.

Bootstrap Navbar collapse point < 768px

This is an OLD question for Bootstrap 3 -> changing the collapse point for the navbar, but the methodologies suggested here:
https://coderwall.com/p/wpjw4w/change-the-bootstrap-navbar-breakpoint
and here:
Bootstrap 3 Navbar Collapse
do not work for collapsing below 768px, it only seems to work for extending the collapse point, not retracting it. I have a particular situation where my navbar has 3 buttons, so it doesn't need to collapse so early. I would like it to collapse at 420px instead.
Is there a CSS solution to this? If not, can somebody point me towards the correct attribute in the bootstrap customisation page which I need to change and download? Is it the generic breakpoints perhaps? Because there is nothing I can see which says Navbar breakpoints:
http://getbootstrap.com/customize/
As requested, my HTML for the navbar is simply:
<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="#navbar" aria-expanded="false" aria-controls="navbar">
<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="navbar-collapse collapse" id = "navbar">
<ul class="nav navbar-nav navbar-left">
<li class = "navbar_buttons"><a id = "new_route_button"><strong>New Route</strong></a></li>
<li class="divider-vertical"></li>
<li class = "navbar_buttons"><a id = "clear_route_button">Clear Route</a></li>
</ul>
<ul class="nav navbar-nav navbar-right"> <!--Right justified navbar list-->
<li class = "navbar_buttons"><a id = "about_button">About</a></li>
</ul>
</div>
</div> <!-- Container -->
</nav> <!-- End of Navbar Container -->
Then I have some CSS to add a vertical division:
/*Preventing vertical dividers from appearing collapsed*/
#media (max-width: 420px) {
.navbar-collapse .nav > .divider-vertical {
display: none;
}
}
/*Defining the vertical dividers*/
.navbar .divider-vertical {
height: 50px;
margin: 0 9px;
border-right: 1px solid #ffffff;
border-left: 1px solid #DADADA;
}
.navbar-inverse .divider-vertical {
border-right-color: #222222;
border-left-color: #111111;
}
Yes, changing the breakpoint to anything less than 768px is different than changing the breakpoint over 768px. You need to override all of the Bootstrap defaults that normally make it collapse.
#media only screen and (min-width: 420px) {
.collapse {
display: block;
}
.navbar-header {
float: left;
}
.navbar-toggle {
display: none;
}
.navbar-nav.navbar-left {
float: left;
margin: 0;
}
.navbar-nav.navbar-right {
float: right;
margin: 0;
}
.navbar-nav>li {
float: left;
}
.navbar-nav>li>a {
padding-top: 15px;
padding-bottom: 15px;
}
}
#media only screen and (max-width: 420px) {
.collapse {
display: none;
}
.navbar-header {
display: block;
}
}
http://www.bootply.com/wpUuFIZqJ2
The following code snippet is based on the original answer, but also works when there are drop down menus in the navbar.
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style>
#media only screen and (min-width: 560px) {
.collapse {
display: block;
}
.navbar-header {
float: left;
}
.navbar-toggle {
display: none;
}
.navbar>.container .navbar-brand,
.navbar>.container-fluid .navbar-brand {
margin-left: -15px;
}
.container>.navbar-header,
.container-fluid>.navbar-header,
.container>.navbar-collapse,
.container-fluid>.navbar-collapse {
margin-right: 0;
margin-left: 0;
}
.navbar-nav {
float: left;
margin: 0;
}
.navbar-nav.navbar-right {
float: right;
margin: 0;
}
.navbar-nav>li {
float: left;
}
.navbar-nav>li>a {
padding-top: 15px;
padding-bottom: 15px;
}
.navbar-nav .open .dropdown-menu {
position: absolute;
float: left;
width: auto;
margin-top: 2px;
background-color: #fff;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, 0.15);
-webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
}
.navbar-inverse .navbar-nav .open .dropdown-menu .divider {
background-color: #e5e5e5;
}
.navbar-inverse .navbar-nav .open .dropdown-menu>li>a {
color: #333;
}
.navbar-nav .open .dropdown-menu>li>a {
line-height: 1.42857143;
}
.navbar-nav .open .dropdown-menu>li>a,
.navbar-nav .open .dropdown-menu .dropdown-header {
padding: 3px 20px;
}
.navbar-right .dropdown-menu {
right: 0;
left: auto;
}
}
#media only screen and (max-width: 559px) {
.collapse {
display: none;
}
.navbar-header {
display: block;
}
}
</style>
<nav class="navbar navbar-default">
<div class="container-fluid">
<!-- 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" href="#">Brand</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">
<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>
<ul class="nav navbar-nav navbar-right">
<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>
</ul>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
</nav>

Bootstrap Navbar link background height

I have made my navbar taller in bootstrap using
.navbar {
padding-top: 15px;
padding-bottom: 15px;
}
However now the background of the active navbar link looks like this
How do I get the pictured grey background to span the full height of the navbar? I tried various things such as increasing the padding, and this does make it taller, but it doesn't actually extend over the purple, which is what I want.
Example here: http://jsfiddle.net/pjxd9cka/
#import url('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css');
.navbar {
padding-top: 15px;
padding-bottom: 15px;
border: 0;
border-radius: 0;
margin-bottom: 0;
font-size: 12px;
letter-spacing: 5px;
}
<header class="navbar navbar-inverse navbar-fixed-top bs-docs-nav" role="banner">
<div class="container">
<div class="navbar-header">
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".bs-navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
Bootstrap 3 Menu Generator
</div>
<nav class="collapse navbar-collapse bs-navbar-collapse" role="navigation">
<ul class="nav navbar-nav">
<li>
Getting started
</li>
<li class="dropdown">
Dropdown <b class="caret"></b>
<ul class="dropdown-menu">
<li>Action</li>
<li>Another action</li>
<li>Something else here</li>
<li>Separated link</li>
<li>One more separated link</li>
</ul>
</li>
<li>
Components
</li>
<li>
JavaScript
</li>
<li class="active">
Customize
</li>
</ul>
</nav>
</div>
</header>
<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>
The active element is what's producing the highlighted color, meaning you need to make the active element larger if you want it to grow.
One solution is to add your additional padding to the a elements inside the menu instead of to the outer menu container. Since bootstrap's default padding is 15px, you'll need to make it 15+15=30px top and bottom. It may also be different padding for different media screen sizes. Once you do this, in order to keep the navbar-header aligned, you'll need to add a margin to the top of that too.
.navbar {
border: 0;
border-radius: 0;
margin-bottom: 0;
font-size: 12px;
letter-spacing: 5px;
background-color: teal;
}
.navbar-header {
margin-top: 15px;
}
.nav li a {
padding-top: 30px;
padding-bottom: 30px;
}
Here's a fiddle illustrating this.
A quick fix would be to add a negative margin to your links.
.navbar a {
margin-top: -15px;
margin-bottom: -15px;
Or perhaps a better method would be to change play with the height of the links.
.navbar a {
height: 100%;
margin-top: 0;
margin-bottom: 0;
I've redefined paddings and margins for three other classes instead of the .navbar class:
.navbar-brand
.navbar-toggle
.navbar-nav > li > a
Please check the result: http://jsfiddle.net/glebkema/hwk7kjmo/
#import url('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css');
.navbar {
/*
padding-top: 15px;
padding-bottom: 15px;
*/
border: 0;
border-radius: 0;
margin-bottom: 0;
font-size: 12px;
letter-spacing: 5px;
}
.navbar-brand {
height: 80px; /* 50px by default */
padding-bottom: 30px; /* 15px by default */
padding-top: 30px;
}
.navbar-toggle {
margin-bottom: 20px; /* 8px by default */
margin-top: 20px;
padding-bottom: 12px; /* 9px by default */
padding-top: 12px;
}
#media (min-width: 768px) {
.navbar-nav > li > a {
padding-bottom: 30px; /* 15px by default */
padding-top: 30px;
}
}
<header class="navbar navbar-inverse navbar-fixed-top bs-docs-nav" role="banner">
<div class="container">
<div class="navbar-header">
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".bs-navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
Bootstrap 3 Menu Generator
</div>
<nav class="collapse navbar-collapse bs-navbar-collapse" role="navigation">
<ul class="nav navbar-nav">
<li>
Getting started
</li>
<li class="dropdown">
Dropdown <b class="caret"></b>
<ul class="dropdown-menu">
<li>Action</li>
<li>Another action</li>
<li>Something else here</li>
<li>Separated link</li>
<li>One more separated link</li>
</ul>
</li>
<li>
Components
</li>
<li>
JavaScript
</li>
<li class="active">
Customize
</li>
</ul>
</nav>
</div>
</header>
<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>

bootstrap dropdown nav over/underlap over content below

This may be tricky to answer/explain properly but:
Building small website for school project. Using bootstrap. When screen is below 780px the nav bar turns into the mobile design with the button icon when clicked has the dropdown menu.
The issue is the menu is meant to push content under it down when its open but it is just going over my content on some page/ under a slideshow i have on main page and it is unclickable as the content sits over it.
I've tried to include all relevant code, it is a complete mess however. Because of all the HTML/CSS and bootstrap and jquery links it's too hard to post in a jfiddle.
Can anyone see anything that would be wrong??
Here is a screenshot of the problem:
http://imgur.com/c5WMDZi
HTML:
<!-- Start of nav bar -->
<div class="bottomHeader">
<nav class="navbar navbar-default">
<div class="container-fluid">
<!-- 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">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- 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>Home</li>
<li class="dropdown">
Products<span class="caret"></span>
<ul class="dropdown-menu" role="menu">
<li>Action</li>
<li>Another action</li>
<li>Something else here</li>
<li class="divider"></li>
<li>Separated link</li>
</ul>
</li>
<li class="dropdown">
Services<span class="caret"></span>
<ul class="dropdown-menu" role="menu">
<li>Action</li>
<li>Another action</li>
<li>Something else here</li>
<li class="divider"></li>
<li>Separated link</li>
</ul>
</li>
<li class="dropdown">
Deals<span class="caret"></span>
<ul class="dropdown-menu" role="menu">
<li>Action</li>
<li>Another action</li>
<li>Something else here</li>
<li class="divider"></li>
<li>Separated link</li>
</ul>
</li>
<li>My Account</li>
<li class="dropdown searchDropDown">
Search<span class="caret"></span>
<ul class="dropdown-menu" role="menu">
<li><form role="search">
<input type="text" class="form-control searchBox" placeholder="Search">
<button type="submit" class="btn btn-default">Submit</button>
</form>
</li>
</ul>
</li>
</ul>
<!-- SEARCH BUTTON -->
<div class="searchSection">
<form class="searchRight" role="search">
<input type="text" class="form-control searchBox" placeholder="Search">
<button type="submit" class="btn btn-default">Submit</button>
</form>
</div>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
</div> <!-- end bottom header div -->
</div> <!-- end header div -->
</header>
<!-- START OF PAGE CONTENT -->
<content>
<div class="background">
<div class="container2">
<div class="trial"> BOO<br>BOO<br>BOO<br>BOO<br>BOO<br>BOO<br>
</div>
</div>
</div>
</content>
</html>
CSS:
.headerBox {
background-color: #0076a3;
width: 100%;
margin: 0 auto;
height: 115px;
}
.topHeader {
background-color: transparent;
}
.dellImgBox {
padding-left: 42px;
background-color: transparent;
}
.socialMediaBox {
float: right;
margin-right: 53px;
padding-top: 5px;
}
.smImg {
background-color: transparent;
margin-right: 5px;
display: inline-block;
}
.smImgLeft {margin-left: 30px;}
.socialMediaBox a:hover {
background: transparent;
}
/******* Bottom Header ********/
.bottomHeader {
border: 0px solid black;
background-color: transparent;
height: 53px;
}
.navbar-default {
background-color: transparent;
border: 0px;
}
.navbar-header {
float: right;
}
.trial {
margin: 20px 20px;
border: 1px solid black;
min-height: 300px;
color: #444;
}
/* Have nav on right position & display DDmenu */
#media screen and (min-width: 772px) {
.container > .navbar-header,
.container-fluid > .navbar-header,
.container > .navbar-collapse,
.container-fluid > .navbar-collapse {
margin-right: 30px;
margin-left: 0;
margin-top: -13px;
}
ul.nav li.dropdown:hover > ul.dropdown-menu {
display: block;
}
}
#media screen and (max-width: 771px) {
.topHeader {display:none;}
.headerBox {height: 55px;}
ul.nav.navbar-nav {width: 260px;}
}
/* Hide Main Search input field # Xwidth */
#media screen and (max-width: 882px) {
.searchSection {display: none;}
.searchDropDown {display: block;}
}
#media screen and (min-width: 883px) {
.searchDropDown {
display: none!important;
}
}
In your CSS file you should remove height: 53px; and it will work.
.bottomHeader {
border: 0px solid black;
background-color: transparent;
height: 53px;
}
Change to this one:
.bottomHeader {
border: 0px solid black;
background-color: transparent;
}
That's because you have overrided navbar-default class and added background-color:transparent. Just comment it and you can find it on the top of all.
DEMO
.navbar-default {
/*background-color: transparent;*/
border: 0px;
z-index:100000;//Add this property
}