Navbar Button doesn't vertically align - html

i have been playing around with bootstrap to setup a navbar the way i would like it to be.
I am struggling as you might see in my code to have everything vertically centered properly in this menu. I have made some average fix by playing with the margin but i can't fix the button.
I am sure there is a simple solution with position:relative to have everything center but i can't find it.
http://codepen.io/anon/pen/yMGEZb
Thanks for your help !

updated codepen
Just add the button inside navbar-right li.no need to modify your css.
example snippet
.navbar-default .navbar-header .navbar-brand {
font-family: 'Catamaran', 'Helvetica', 'Arial', 'sans-serif';
font-weight: 200;
letter-spacing: 1px;
color: #fdcc52;
}
.navbar-default .navbar-header .navbar-brand:hover,
.navbar-default .navbar-header .navbar-brand:focus {
color: #fcbd20;
}
.navbar-default .navbar-header .navbar-toggle {
font-size: 12px;
color: #222222;
padding: 8px 10px;
}
.navbar-default .nav > li > a {
font-family: Montserrat;
font-weight:300;
font-style:normal;
text-transform: uppercase;
letter-spacing: 2px;
font-size: 13px;
color: #121212;
}
/*#media (min-width: 768px)
.button-nav {
display: inline-block;
z-index: 101;
}*/
.button-nav {
position: relative;
bottom: 50%;
background-color: transparent;
font-family: Montserrat;
font-weight: 300;
font-style:normal;
letter-spacing:2px;
font-size: 13px;
color: #121212;
text-transform: uppercase;
border: 1px solid #121212;
padding: 18px 40px;
transition: color .4s cubic-bezier(.694,.0482,.335,1),background-color .4s cubic-bezier(.694,.0482,.335,1),border .4s cubic-bezier(.694,.0482,.335,1);
cursor:pointer;
text-align:center;
text-rendering: optimizeLegibility;
}
.button-nav:hover {
background-color: #1c1c1c;
font-family: Montserrat;
font-weight: 300;
font-style:normal;
letter-spacing:2px;
font-size: 13px;
color: white;
text-transform: uppercase;
border: 1px solid #1c1c1c;
padding: 18px 40px;
transition: color .4s cubic-bezier(.694,.0482,.335,1),background-color .4s cubic-bezier(.694,.0482,.335,1),border .4s cubic-bezier(.694,.0482,.335,1);
cursor:pointer;
text-align:center;
text-rendering: optimizeLegibility;
}
.navbar-default .nav > li > a,
.navbar-default .nav > li > a:focus {
color: #121212;
}
.navbar-default .nav > li > a:hover,
.navbar-default .nav > li > a:focus:hover {
color: #fdcc52;
}
.navbar-default .nav > li.active > a,
.navbar-default .nav > li.active > a:focus {
color: #fdcc52 !important;
background-color: transparent;
}
.navbar-default .nav > li.active > a:hover,
.navbar-default .nav > li.active > a:focus:hover {
background-color: transparent;
}
#media (min-width: 768px) {
.navbar-default {
background-color: transparent;
border-color: transparent;
}
.navbar-default .navbar-header .navbar-brand {
color: rgba(34, 34, 34, 0.1);
}
.navbar-default .navbar-header .navbar-brand:hover,
.navbar-default .navbar-header .navbar-brand:focus {
color: white;
}
.navbar-default .nav > li > a,
.navbar-default .nav > li > a:focus {
color: #121212;
}
.navbar-default .nav > li > a:hover,
.navbar-default .nav > li > a:focus:hover {
color: white;
}
.navbar-default.affix {
background-color: white;
border-color: rgba(34, 34, 34, 0.1);
}
.navbar-default.affix .navbar-header .navbar-brand {
color: #222222;
}
.navbar-default.affix .navbar-header .navbar-brand:hover,
.navbar-default.affix .navbar-header .navbar-brand:focus {
color: #fdcc52;
}
.navbar-default.affix .nav > li > a,
.navbar-default.affix .nav > li > a:focus {
color: #222222;
}
.navbar-default.affix .nav > li > a:hover,
.navbar-default.affix .nav > li > a:focus:hover {
color: #fdcc52;
}
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<nav id="mainNav" class="navbar navbar-default navbar-fixed-top">
<div class="container" style="height:80px;">
<!-- 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> Menu <i class="fa fa-bars"></i>
</button>
<a class="navbar-brand page-scroll" href="#page-top">
<img src="http://svgshare.com/i/17J.svg" width="220" height="50" alt="">
</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right" style="margin-top:20px;">
<li>
<a class="page-scroll" href="#download">Download</a>
</li>
<li>
<a class="page-scroll" href="#features">Features</a>
</li>
<li>
<a class="page-scroll" href="#contact">Contact</a>
</li>
<li><button class="button-nav pull-right">Get started</button></li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
</nav>

Related

Centering the logo even with different monitor/resolution

I want to center the logo. I was able to center it by defining the padding and stuff but the problem is that the logo moves when I try to view it on a different monitor/resolution.
Here's the Code:
/* Navigation */
.navbar {-moz-border-radius: 0;-webkit-border-radius: 0;border-radius: 0;margin-bottom: 0;}
.navbar .container {text-align: center; position: center; background-color: #fff; right:55px;}
.navbar-default {-moz-transition: all 0.3s ease-out;-o-transition: all 0.3s ease-out;-webkit-transition: all 0.3s ease-out;transition: all 0.3s ease-out;width: 100%;border: none;border-bottom: 0px solid #e7e7e7;background-color: #fff; }
.navbar-default .navbar-nav > li > a {color: #000;font-weight: normal;font-size: 15px; display: inline-block; padding-right: 23px; padding-left: 23px}
.navbar-default .navbar-nav > li > a:hover {background-color: transparent;color: #005FA6;}
.navbar-default .navbar-nav > .open > a,.navbar-default .navbar-nav > .open > a:hover,.navbar-default .navbar-nav > .open > a:focus {background-color: transparent;color: #005FA6;}
.navbar-default .navbar-nav .active > a,.navbar-default .navbar-nav .active > a:hover,.navbar-default .navbar-nav .active > a:focus {color: #005FA6;background-color: transparent;}
.navbar-default .navbar-toggle {margin: 10px 0 0 15px;}
.navbar-default .navbar-toggle,.navbar-default .navbar-toggle:hover,.navbar-default .navbar-toggle:focus {border: none;background: #f3f3f3;}
.navbar-default .navbar-toggle i {font-size: 31px;}
.navbar-default .navbar-collapse {float: right; border-top: none;padding-left: 0;padding-right: 0;}
.navbar-brand>img {padding: 5px; align: center;}
<nav class="navbar navbar-default">
<div class="container">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-navbar-collapse">
<span class="sr-only">Toggle Navigation</span>
<i class="fa fa-bars"></i>
</button>
<a href="index.php" class="navbar-brand">
<img src="img/corelogo.png" alt="" height="150" width="150">
</a>
</div>
</nav>
Set your logo <img> tag as display:block. Then give it a left and right margin of auto.
Example below:
/* Navigation */
.navbar {
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
margin-bottom: 0;
}
.navbar .container {
text-align: center;
position: center;
background-color: #fff;
right: 55px;
}
.navbar-default {
-moz-transition: all 0.3s ease-out;
-o-transition: all 0.3s ease-out;
-webkit-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
width: 100%;
border: none;
border-bottom: 0px solid #e7e7e7;
background-color: #fff;
}
.navbar-default .navbar-nav>li>a {
color: #000;
font-weight: normal;
font-size: 15px;
display: inline-block;
padding-right: 23px;
padding-left: 23px
}
.navbar-default .navbar-nav>li>a:hover {
background-color: transparent;
color: #005FA6;
}
.navbar-default .navbar-nav>.open>a,
.navbar-default .navbar-nav>.open>a:hover,
.navbar-default .navbar-nav>.open>a:focus {
background-color: transparent;
color: #005FA6;
}
.navbar-default .navbar-nav .active>a,
.navbar-default .navbar-nav .active>a:hover,
.navbar-default .navbar-nav .active>a:focus {
color: #005FA6;
background-color: transparent;
}
.navbar-default .navbar-toggle {
margin: 10px 0 0 0;
}
.navbar-default .navbar-toggle,
.navbar-default .navbar-toggle:hover,
.navbar-default .navbar-toggle:focus {
border: none;
background: #f3f3f3;
}
.navbar-default .navbar-toggle i {
font-size: 31px;
}
.navbar-default .navbar-collapse {
float: right;
border-top: none;
padding-left: 0;
padding-right: 0;
}
.navbar-brand img {
border:1px solid black;
width:150px;
height:150px;
display:block;
margin: 15px auto 0px auto;
}
<nav class="navbar navbar-default">
<div class="container">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-navbar-collapse">
<span class="sr-only">Toggle Navigation</span>
<i class="fa fa-bars"></i>
</button>
<a href="index.php" class="navbar-brand">
<img src="img/corelogo.png" alt="" height="150" width="150">
</a>
</div>
</nav>
You just need make your image a block element by adding display: block; and then adding an auto margin with margin: 0 auto;
Here is your code: .navbar-brand > img { display: block; margin: 0 auto;}
<style>
.navbar {-moz-border-radius: 0;-webkit-border-radius: 0;border-radius: 0;margin-bottom: 0;}
.navbar .container {text-align: center; position: center; background-color: #fff; right:55px;}
.navbar-default {-moz-transition: all 0.3s ease-out;-o-transition: all 0.3s ease-out;-webkit-transition: all 0.3s ease-out;transition: all 0.3s ease-out;width: 100%;border: none;border-bottom: 0px solid #e7e7e7;background-color: #fff; }
.navbar-default .navbar-nav > li > a {color: #000;font-weight: normal;font-size: 15px; display: inline-block; padding-right: 23px; padding-left: 23px}
.navbar-default .navbar-nav > li > a:hover {background-color: transparent;color: #005FA6;}
.navbar-default .navbar-nav > .open > a,.navbar-default .navbar-nav > .open > a:hover,.navbar-default .navbar-nav > .open > a:focus {background-color: transparent;color: #005FA6;}
.navbar-default .navbar-nav .active > a,.navbar-default .navbar-nav .active > a:hover,.navbar-default .navbar-nav .active > a:focus {color: #005FA6;background-color: transparent;}
.navbar-default .navbar-toggle {margin: 10px 0 0;}
.navbar-default .navbar-toggle,.navbar-default .navbar-toggle:hover,.navbar-default .navbar-toggle:focus {border: none;background: #f3f3f3;}
.navbar-default .navbar-toggle i {font-size: 31px;}
.navbar-default .navbar-collapse {float: right; border-top: none;padding-left: 0;padding-right: 0;}
.navbar-brand > img { display: block; margin: 0 auto;}
</style>
<nav class="navbar navbar-default">
<div class="container">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-navbar-collapse">
<span class="sr-only">Toggle Navigation</span>
<i class="fa fa-bars"></i>
</button>
<a href="index.php" class="navbar-brand">
<img class="my-image" src="img/corelogo.png" alt="" height="150" width="150">
</a>
</div>
</nav>

navbar-right is not responding in bootstrap navigation

I am trying to create a small Sinatra app. Currently, trying to set up a conditional navigation bar with the help of bootstrap. I am trying to use navbar-right to show sign up/ login/ logout links on the right side but it's not working correctly. It just shows everything on left. My code for navbar looks like below..
Coding Tips
<!-- Collect the nav links, forms, and other content for toggling -->
<div >
<!-- Main nav bar -->
<ul class="navbar-right nav navbar-nav">
<% if logged_in? %>
<li>
User's tips
</li>
<li>
New Tip
</li>
<li>
Sign out
</li>
<% else %>
<li>
Sign Up
</li>
<li>
Sign In
</li>
<% end %>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
I also added style.css to custom style my navbar, which looks like below..
./*///// NAVBAR ////*/
/* while header */
.navbar-default { background-color: #111111; border-color: transparent; -webkit-transition: all 0.35s; -moz-transition: all 0.35s; transition: all 0.35s; font-family: 'Catamaran', 'Helvetica', 'Arial', 'sans-serif'; font-weight: 300; letter-spacing: 1px; font-size: 5em; /* while fixed */ }
.navbar-default .navbar-header .navbar-brand { font-family: 'Arial', 'sans-serif'; font-size: 1em; color: #31002e; font-weight: 200; text-transform: uppercase; padding: 20px 25px; }
.navbar-default .navbar-header .navbar-brand:hover, .navbar-default .navbar-header .navbar-brand:focus { color: #FF0000; }
.navbar-default .navbar-header .navbar-toggle {font-family: 'Arial', 'sans-serif'; font-size: 1em; color: #31002e; font-weight: 200; text-transform: uppercase; padding: 20px 25px;}
.navbar-default .nav > li > a { font-family: 'Arial', 'sans-serif'; text-transform: uppercase; letter-spacing: 2px; font-size: 1em; font-weight: 200; color: #31002e; padding: 20px 25px; }
.navbar-default .nav > li > a:focus { color: #FF0000; }
.navbar-default .nav > li > a:hover, .navbar-default .nav > li > a:focus:hover { color: #FF0000; }
.navbar-default .nav > li.active > a { color: #FF0000; background-color: #111111; }
.navbar-default .nav > li.active > a:focus { color: #FF0000; background-color: #111111; }
.navbar-default .nav > li.active > a:hover, .navbar-default .nav > li.active > a:focus:hover { background-color: #111111; }
.navbar-default .nav > li > a.selected { color: #fff; background-color: black;}
.navbar-default .affix { background-color: #111111; }
.navbar-default .affix .navbar-header .navbar-brand:hover, .navbar-default .affix .navbar-header .navbar-brand:focus { color: #FF0000; }
.navbar-default .affix .nav > li.active > a { color: #FF0000; }
.navbar-default .affix .nav > li.active > a:focus { color: #FF0000; }
.navbar-default .affix .nav > li > a:hover, .navbar-default .affix .nav > li > a:active, .navbar-default .affix .nav > li > a:focus, .navbar-default .affix .nav > li > a:focus:hover { color: #FF0000; }
Any suggestion to solve this problem?
Add a pull-right to your ul should fix it:
pull-right class you can find the source here:
.pull-right {
float: right !important;
}
.pull-left {
float: left !important;
}
https://github.com/twbs/bootstrap/blob/v3.3.7/dist/css/bootstrap.css#L6519-L6524
.
/*///// NAVBAR ////*/
/* while header */
.navbar-default {
background-color: #111111;
border-color: transparent;
-webkit-transition: all 0.35s;
-moz-transition: all 0.35s;
transition: all 0.35s;
font-family: 'Catamaran', 'Helvetica', 'Arial', 'sans-serif';
font-weight: 300;
letter-spacing: 1px;
font-size: 5em;
/* while fixed */
}
.navbar-default .navbar-header .navbar-brand {
font-family: 'Arial', 'sans-serif';
font-size: 1em;
color: #31002e;
font-weight: 200;
text-transform: uppercase;
padding: 20px 25px;
}
.navbar-default .navbar-header .navbar-brand:hover,
.navbar-default .navbar-header .navbar-brand:focus {
color: #FF0000;
}
.navbar-default .navbar-header .navbar-toggle {
font-family: 'Arial', 'sans-serif';
font-size: 1em;
color: #31002e;
font-weight: 200;
text-transform: uppercase;
padding: 20px 25px;
}
.navbar-default .nav > li > a {
font-family: 'Arial', 'sans-serif';
text-transform: uppercase;
letter-spacing: 2px;
font-size: 1em;
font-weight: 200;
color: #31002e;
padding: 20px 25px;
}
.navbar-default .nav > li > a:focus {
color: #FF0000;
}
.navbar-default .nav > li > a:hover,
.navbar-default .nav > li > a:focus:hover {
color: #FF0000;
}
.navbar-default .nav > li.active > a {
color: #FF0000;
background-color: #111111;
}
.navbar-default .nav > li.active > a:focus {
color: #FF0000;
background-color: #111111;
}
.navbar-default .nav > li.active > a:hover,
.navbar-default .nav > li.active > a:focus:hover {
background-color: #111111;
}
.navbar-default .nav > li > a.selected {
color: #fff;
background-color: black;
}
.navbar-default .affix {
background-color: #111111;
}
.navbar-default .affix .navbar-header .navbar-brand:hover,
.navbar-default .affix .navbar-header .navbar-brand:focus {
color: #FF0000;
}
.navbar-default .affix .nav > li.active > a {
color: #FF0000;
}
.navbar-default .affix .nav > li.active > a:focus {
color: #FF0000;
}
.navbar-default .affix .nav > li > a:hover,
.navbar-default .affix .nav > li > a:active,
.navbar-default .affix .nav > li > a:focus,
.navbar-default .affix .nav > li > a:focus:hover {
color: #FF0000;
}
<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>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<!-- Collect the nav links, forms, and other content for toggling -->
<div>
<!-- Main nav bar -->
<ul class="navbar-right nav navbar-nav pull-right">
<% if logged_in? %>
<li>
User's tips
</li>
<li>
New Tip
</li>
<li>
Sign out
</li>
<% else %>
<li>
Sign Up
</li>
<li>
Sign In
</li>
<% end %>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
</nav>

Make my nav bar center

I want to be able to center my nav bar on the screen . for the nav bar i created a list. i tried using a table element, however than i would lose my links. My goal for this is just to have the nav bar to be centered under the logo.
font-size: 48px;
}
.img {
text-align: center;
}
.table {
/*display: table; Allow the centering to work */
margin: 0 auto;
}
ul#horizontal-list {
min-width: 100%;
list-style: none;
padding-top: 20px;
}
ul#horizontal-list li {
display: inline;
}
.logo {
/* top: 200px;*/
position: relative;
text-align: center;
}
ul {
float: center;
position: relative;
text-align: center;
/*margin-left: auto;
margin-right: auto;*/
list-style-type: none;
margin: 0;
padding: 0;
/* overflow: hidden;*/
background-color: white;
z-index: -2;
}
li {
float: left;
border-top:3px solid #C5908E;
border-bottom:3px solid #C5908E;
padding: 5px;
}
li:first-child {
border-left: 3px solid #C5908E;
}
li:last-child {
border-right: 3px solid #C5908E;
}
/*to change font */
li a {
text-align: center;
display: inline;
color: #484846;
font-size: 30px;
font-family: 'Poiret One', cursive;
padding: 5px ;
text-decoration: none;
}
.links a:link {color:#484846; background-color:transparent; text-decoration:none}
.links a:visited {color:#484846; background-color:transparent; text-decoration:none}
.links a:hover {color:#C5908E; background-color:transparent; text-decoration:none}
.links a:active {color:#484846; background-color:transparent; text-decoration:none}
.wrapper {
  /*padding: 20px;*/
  text-align: center;
}
</style>
<!DOCTYPE html>
<html>
<head>
<link href="https://fonts.googleapis.com/css?family=Poiret+One" rel="stylesheet">
<style>
#font-face {
font-family: 'Poiret One', cursive;
<div class= "title">
</div>
<title>
Kristin Fincken
</title>
</div>
</head>
<body>
</div>
<div class="wrapper">
<br>
<div class="logo">
<img src="images/logo.png" usemap="#rec">
</div>
</div>
<br>
<br>
<br>
<div class ="links" >
<div class="table">
<ul id="horizontal-list">
<li><a href="html/design.html" >Design </a></li>
<li> Photo </li>
<li>Web</li>
<li>Words</li>
</font>
</ul>
</div>
</div>
</body>
</html>
Don't use a table for that. Look at this http://codepen.io/mlegg10/pen/EZdxbd
You should also validate your code for all your errors https://validator.w3.org/nu/
$(function() {
$('a.page-scroll').bind('click', function(event) {
var $anchor = $(this);
$('html, body').stop().animate({
scrollTop: $($anchor.attr('href')).offset().top
}, 1500, 'easeInOutExpo');
event.preventDefault();
});
});
// Highlight the top nav as scrolling occurs
$('body').scrollspy({
target: '.navbar-fixed-top'
})
// Closes the Responsive Menu on Menu Item Click
$('.navbar-collapse ul li a').click(function() {
$('.navbar-toggle:visible').click();
});
.navbar-default .navbar-brand {
font-family: 'Poiret One', cursive;
color: #1ee2e7;
}
.navbar-default .navbar-brand:hover,
.navbar-default .navbar-brand:focus,
.navbar-default .navbar-brand:active,
.navbar-default .navbar-brand.active {
color: #fec503;
}
.navbar-default .navbar-collapse {
border-color: rgba(255,255,255,.02);
}
.navbar-default .navbar-toggle {
border-color: #1ee2e7;
background-color: #1ee2e7;
}
.navbar-default .navbar-toggle .icon-bar {
background-color: #fff;
}
.navbar-default .navbar-toggle:hover,
.navbar-default .navbar-toggle:focus {
background-color: #1ee2e7;
}
.navbar-default .nav li a {
text-transform: uppercase;
font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif;
font-weight: 400;
letter-spacing: 1px;
color: #fff;
}
.navbar-default .nav li a:hover,
.navbar-default .nav li a:focus {
outline: 0;
color: #1ee2e7;
}
.navbar-default .navbar-nav>.active>a {
border-radius: 0;
color: #fff;
background-color: #1ee2e7;
}
.navbar-default .navbar-nav>.active>a:hover,
.navbar-default .navbar-nav>.active>a:focus {
color: #fff;
background-color: #17d0d5;
}
#media(min-width:768px) {
.navbar-default {
padding: 25px 0;
border: 0;
background-color: transparent;
-webkit-transition: padding .3s;
-moz-transition: padding .3s;
transition: padding .3s;
}
.navbar-default .navbar-brand {
font-size: 2em;
-webkit-transition: all .3s;
-moz-transition: all .3s;
transition: all .3s;
}
.navbar-default .navbar-nav>.active>a {
border-radius: 3px;
}
.navbar-default.navbar-shrink {
padding: 10px 0;
background-color: #222;
}
.navbar-default.navbar-shrink .navbar-brand {
font-size: 1.5em;
}
}
<!-- Navigation -->
<nav class="navbar navbar-default navbar-fixed-top navbar-shrink">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header page-scroll">
<button type="button" class="navbar-toggle" 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 page-scroll" href="#page-top">Kristin Fincken</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">
<li class="hidden active">
</li>
<li class="">
<a class="page-scroll" href="design.html">Design</a>
</li>
<li class="">
<a class="page-scroll" href="photos.html">Photos</a>
</li>
<li class="">
<a class="page-scroll" href="web.html">Web</a>
</li>
<li class="">
<a class="page-scroll" href="words.html">Words</a>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
</nav>

Bootstrap styling dropdown menu

I'm currently working with a bootstrap navbar but i want to style my dropdown,
I have a "Hamburger" styled dropdown button and my current dropdown looks like this: http://prntscr.com/ctocj2 What i need to do is to style the dropdown. What i'm trying to accomplish is this
body {
margin: 0;
padding: 0;
background-color: lightgrey;
}
.navbar-default {
font-family: "Arial Rounded MT";
font-weight: bold;
font-size: 20px;
position: relative;
background-color: white;
box-shadow: 20px;
padding: 30px;
border: none;
}
.navbar-header {
right: auto;
}
.navbar-nav > li {} .navbar-default .navbar-brand,
.navbar-default .navbar-brand:hover,
.navbar-default .navbar-brand:focus {
color: black;
font-size: 30px;
}
.navbar-default .navbar-nav > li > a {
color: #3E6AAF;
}
.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus {
color: #0042a5;
opacity: 0.5;
}
.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus {
color: #3E6AAF;
background-color: transparent;
}
.navbar-default .navbar-text {
color: #FFF;
}
.navbar-default .navbar-toggle {
background-color: transparant;
border: none;
}
.navbar-toggle .icon-bar {
height: 8px;
width: 50px;
border-radius: 10px;
}
.navbar-default .navbar-toggle:hover,
.navbar-default .navbar-toggle:focus {
background-color: ;
}
.navbar-default .navbar-toggle .icon-bar {
background-color: #3E6AAF;
border: none;
}
.col-md-5 {
font-family: "Lato-Bold";
padding: 10px;
color: white;
font-size: 20px;
}
.col-md-12 {
font-family: "Lato-Bold";
height: 520px;
padding: 10px;
color: white;
}
.navbar-collapse {
border: 0px;
}
.navbar-default .navbar-collapse {
color: #e7e7e7;
}
.navbar-default .navbar-collapse,
.navbar-default .navbar-form {
border-color: transparent;
box-shadow: none;
}
.dropdown-menu {
background-color: transparent;
;
text-decoration-color: black;
}
.dropdown-toggle {
background-color: transparent;
color: black;
}
.navbar-default .navbar-nav .open .dropdown-menu>li>a,
.navbar-default .navbar-nav .open .dropdown-menu {
background-color: black;
color: white;
}
.navbar-right {
padding-right: 100px;
}
.navbar-brand {
position: relative;
right: 15%;
display: block;
padding-top: -100px;
width: 50%;
}
<!DOCTYPE html>
<html lang="en">
<head>
<title>Niet beschikbaar</title>
<link rel="shortcut icon" href="img/favicon2.ico" type="image/x-icon">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<link rel="stylesheet" href="css/style.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"> </script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"> </script>
</head>
<body>
<!-- NAVIGATIE BALK -->
<nav class="navbar navbar-default" role="navigation">
<!-- logo -->
<div class="navbar-header">
<!-- -->
<a class="pull-right navbar-brand" href="#">
<img src="img/LOGOBIRSKEN2.svg"/>
</a>
<button type="button" class="pull-left navbar-toggle" data-toggle="collapse" data-target="#mainnavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse" id="mainnavbar">
<ul class="nav navbar-nav">
<li class="active">home</li>
<li>over</li>
<li>diensten</li>
<li>contact</li>
</ul>
</div>
</nav>
<div class="container-fluid">
</div>
I hope you guys can help me out.
Rainier
NOTE:
Its only for mobile
Rainier
bust this css in your style.css
#media (max-width:767px) {
.navbar-nav{ margin:0}
.navbar-nav>li>a{padding-top: 20px;padding-bottom: 20px; border-top:8px solid #406bad}
.navbar-nav>li:last-child>a{border-bottom:8px solid #406bad}
}

I am trying to put a border around .navbar-collapse but can't seem to achieve it

I am trying to add a border around my drop down menu which appears for mobile sizes. Thought it would be to control through .navbar-collapse but it doesn't seem to be working. Any ideas?
Sample pic of mobile size:
My code is as follows:
<nav class="navbar navbar-default navbar-fixed-top">
<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 id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="active">I am fouridine
</li>
<li>design
</li>
<li>animation
</li>
<li>other art
</li>
<li>contact
</li>
</ul>
</ul>
</div>
<!--/.nav-collapse -->
</nav>
CSS for nav is as such:
#media (min-width: 768px) {
.navbar {
display: none;
}
}
.navbar {
min-height:0;
}
.navbar-nav {
margin:0;
}
.navbar-default {
background-color:#47c4c0;
border:0;
height:30px;
font-size: 16px;
}
.container > .navbar-header, .container-fluid > .navbar-header, .container > .navbar-collapse, .container-fluid > .navbar-collapse {
margin:0;
border:0 30px 30px 30px;
}
.nav > li > a {
padding: 5px 20px 5px 20px;
}
.navbar-default .navbar-nav > li > a {
color: #47c4c0;
}
.navbar-default .navbar-nav > li > a:hover, .navbar-default .navbar-nav > li > a:focus {
color: #666666;
}
.navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:hover, .navbar-default .navbar-nav > .active > a:focus {
color: white;
background-color: #47c4c0;
}
.navbar-default .navbar-collapse, .navbar-default .navbar-form {
border:0;
}
.navbar-collapse {
padding:0;
background:white;
border-style:solid;
border-color:#47c4c;
border:0 30px 30px 30px;
}
.navbar-toggle {
padding: 8px;
margin: 0;
border:0;
border-radius: 0;
}
.navbar-toggle .icon-bar {
width: 15px;
}
.navbar-default .navbar-toggle .icon-bar {
background-color: white;
}
.navbar-default .navbar-toggle:hover .icon-bar, .navbar-default .navbar-toggle:focus .icon-bar {
background-color: #47c4c0;
}
.navbar-default .navbar-toggle:hover, .navbar-default .navbar-toggle:focus {
background-color: white;
}
You can apply this to the navbar-nav class. Also see on MDN: border-width
#media (max-width: 767px) {
.navbar.navbar-default .navbar-nav {
background-color: white;
border: none;
margin-top: 0px;
border: solid #47c4c0;
border-width: 0 30px 30px;
}
}
See working Snippet.
#media (min-width: 768px) {
.navbar.navbar-default {
display: none;
}
}
.navbar.navbar-default {
min-height: 0;
background-color: #fff;
border: 0;
height: 30px;
font-size: 16px;
}
.navbar.navbar-default .navbar-nav > li > a {
padding: 5px 20px;
color: #47c4c0;
}
.navbar.navbar-default .navbar-nav > li > a:hover,
.navbar.navbar-default .navbar-nav > li > a:focus {
color: #666666;
}
.navbar.navbar-default .navbar-nav > .active > a,
.navbar.navbar-default .navbar-nav > .active > a:hover,
.navbar.navbar-default .navbar-nav > .active > a:focus {
color: white;
background-color: #47c4c0;
}
.navbar.navbar-default .navbar-collapse,
.navbar.navbar-default .navbar-form {
border: none;
}
#media (max-width: 767px) {
.navbar.navbar-default {
background-color: #47c4c0;
}
.navbar.navbar-default .navbar-toggle {
padding: 8px;
margin: 0;
border: 0;
border-radius: 0;
}
.navbar.navbar-default .navbar-toggle .icon-bar {
width: 15px;
background-color: white;
}
.navbar.navbar-default .navbar-toggle:hover .icon-bar,
.navbar.navbar-default .navbar-toggle:focus .icon-bar {
background-color: #47c4c0;
}
.navbar.navbar-default .navbar-toggle:hover,
.navbar.navbar-default .navbar-toggle:focus {
background-color: white;
}
.navbar.navbar-default .navbar-nav {
background-color: white;
border: none;
margin-top: 0px;
border: solid #47c4c0;
border-width: 0 30px 30px;
}
}
<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-fixed-top">
<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 id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="active">I am fouridine
</li>
<li>design
</li>
<li>animation
</li>
<li>other art
</li>
<li>contact
</li>
</ul>
</ul>
</div>
</nav>
border:0 30px 30px 30px solid black; // or whatever color you want
solid indicates the type of border, could also be dotted|dashed|solid|double|groove|ridge
and just pick the color you want
http://www.w3schools.com/cssref/pr_border-style.asp