Bootstrap Navbar link background height - html

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>

Related

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>

Getting rid of thin separating line above Navbar, Bootstrap3

I'm using Bootstrap 3 for my website. I have the usual .navbar on the page, and it works well, except for one thing that's out of my fashion. There's like a little dividing line between the .navbar-collapse and .navbar-header when the screen shrinks to the hamburger menu. I've boldened it in the pic.
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<title>Stuson.com</title>
<meta name="description" content="Stuson.com is a social media platform for students, by students.">
<meta name="author" content="Stuson Dev Team">
<link href="https://fonts.googleapis.com/css?family=PT+Sans|Roboto" rel="stylesheet">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link href="css\essentials.css" rel="stylesheet">
</head>
<body>
<nav class="navbar navbar-default" 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 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>Link</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>
<form class="navbar-form navbar-left" role="form">
<div class="form-group">
<input type="text" class="form-control hidden-xs" placeholder="Search">
</div>
<button type="submit" class="btn btn-default">
<span class="glyphicon glyphicon-search" aria-hidden="true"></span>
<span class="hidden-lg hidden-md">Search</span>
</button>
</form>
<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>
<script src="http://code.jquery.com/jquery-3.1.1.js" integrity="sha256-16cdPddA6VdVInumRGo6IbivbERE8p7CQR3HzTBuELA=" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script src="js/essentials.js"></script>
</body>
</html>
CSS
#noBorder {
border-style: none;
border-radius: 0;
}
#transparent {
background-color: transparent;
}
body {
font-family: "PT Sans", sans-serif;
font-weight: 300;
}
.navbar {
border-style: none;
border-radius: 0;
background-color: #38ba7d;
}
.navbar .navbar-header {
border-style: none;
border-radius: 0;
}
.navbar .navbar-header > .navbar-toggle,
.navbar .navbar-header .navbar-toggle:hover,
.navbar .navbar-header .navbar-toggle:focus {
border-style: none;
border-radius: 0;
background-color: transparent;
}
.navbar .navbar-header .navbar-brand {
color: #fff;
}
.navbar .navbar-collapse {
border-style: none;
border-radius: 0;
}
.navbar .navbar-collapse ul li > a {
color: #fff;
}
.navbar .navbar-collapse form {
display: flex;
flex-direction: row;
border-style: none;
border-radius: 0;
}
.navbar .navbar-collapse form input {
width: 250px;
}
#media (max-width: 786px) {
.navbar .navbar-collapse form input {
width: 10px;
}
}
.navbar .navbar-collapse form .btn {
background-color: transparent;
border-style: none;
border-radius: 0;
}
How can I avoid this? I've tried using border: none on both .navbar-collapse and .navbar-header, but to no avail.
Actually the 'border' is caused by a box-shadow, so add this:
.navbar .navbar-collapse{
box-shadow:none;
}
You can use this CSS code snippet:
#media (max-width: 768px) {
.navbar-default .navbar-collapse, .navbar-default .navbar-form {
border: 0;
}
}
Setting .navbar-default or .navbar-inverse to 0 should do the trick.
.navbar-default {
border: 0;
}

Collapse button on right side of navbar shows links on left side

first post on SO so sorry if my format is horrible. Just a quick question about a custom fixed-top navbar I'm working on (and I'm very new to Bootstrap and CSS in general). It has a logo as the brand, and three links on the right, one of which is a dropdown, there's also a media query for the the links to collapse sooner (which I found here on SO!). However, when the window is re-sized, and the collapse button is clicked all of the links drop down on the complete left side like it's coming from under the brand. I just want a simple accordion style dropdown for the collapse and for the actual dropdown. Any input is very much appreciated!
Here is the HTML:
<nav class="navbar navbar-default navbar-fixed-top">
<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="#topFixedNavbar1" 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 src="images/logo.jpg" alt="Top Tier Math"></a></div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="topFixedNavbar1">
<ul class="nav navbar-nav navbar-right links">
<li>How We Work</li>
<li>Abous Us</li>
<li class="dropdown">Dropdown<span class="caret"></span>
<ul class="dropdown-menu dropdown-menu-right">
<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>
I also added some css to change the height of the navbar for the logo but I doubt this is the cause. Here it is though.
.navbar-default{
height:120px;
}
.navbar-header, .navbar-brand{
height:120px;
padding-top: 0px;
padding-right: 0px;
padding-bottom: 0px;
padding-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
margin-left: 0px;
}
#topFixedNavbar1{
height:120px;
}
.links{
height:120px;
}
.navbar-nav li a{
line-height:90px;
}
.dropdown li a{
line-height:30px;
}
#media (max-width: 991px) {
.navbar-header {
float: none;
}
.navbar-toggle {
display: block;
}
.navbar-collapse {
border-top: 1px solid transparent;
box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}
.navbar-collapse.collapse {
display: none!important;
}
.navbar-nav {
float: none!important;
margin: 7.5px -15px;
}
.navbar-nav>li {
float: none;
}
.navbar-nav>li>a {
padding-top: 10px;
padding-bottom: 10px;
}
.navbar-text {
float: none;
margin: 15px 0;
}
/* since 3.1.0 */
.navbar-collapse.collapse.in {
display: block!important;
}
.collapsing {
overflow: hidden!important;
}
}
I'm not sure how you want them to display but just use CSS to control the position of the dropdown.
.collapse.navbar-collapse {
width:
margin:
}
You should be able to add styles to this and it will move and change the dropdown.

Bootstrap navbar with permanent right aligned icons

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;
}

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
}