Hello I have a problem with Bootstrap in mobile view. When ever I am in mobile view the image is responsive but its to long for the page and I have to scroll through to see it its cut out.
Mobile view.
I would like it so that the whole image "fits in".
Here is the website:
http://edslab.esy.es/Screen-Brodyr-AB-master/index.html
#topnavbar {
margin: 0;
}
#topnavbar.affix {
position: fixed;
top: 0;
width: 100%;
}
.navbar-nav > li{
padding-left:30px;
padding-right:30px;
}
/*navbar colour*/
.navbar-default {
background-color: #177f5e;
border-color: #ffffff;
}
.navbar-default .navbar-brand {
color: #ffffff;
}
.navbar-default .navbar-brand:hover,
.navbar-default .navbar-brand:focus {
color: #000000;
}
.navbar-default .navbar-text {
color: #ffffff;
}
.navbar-default .navbar-nav > li > a {
color: #ffffff;
}
.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus {
color: #000000;
}
.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus {
color: #000000;
background-color: #ffffff;
}
.navbar-default .navbar-nav > .open > a,
.navbar-default .navbar-nav > .open > a:hover,
.navbar-default .navbar-nav > .open > a:focus {
color: #000000;
background-color: #ffffff;
}
.navbar-default .navbar-toggle {
border-color: #ffffff;
}
.navbar-default .navbar-toggle:hover,
.navbar-default .navbar-toggle:focus {
background-color: #ffffff;
}
.navbar-default .navbar-toggle .icon-bar {
background-color: #ffffff;
}
.navbar-default .navbar-collapse,
.navbar-default .navbar-form {
border-color: #ffffff;
}
.navbar-default .navbar-link {
color: #ffffff;
}
.navbar-default .navbar-link:hover {
color: #000000;
}
#media (max-width: 767px) {
.navbar-default .navbar-nav .open .dropdown-menu > li > a {
color: #ffffff;
}
.navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,
.navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
color: #000000;
}
.navbar-default .navbar-nav .open .dropdown-menu > .active > a,
.navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,
.navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {
color: #000000;
background-color: #ffffff;
}
}
/*whitespace*/
.navbar {
position: relative;
min-height: 50px;
margin-bottom: 20px;
border: 1px solid transparent;
}
.navbar {
margin-bottom: 0px;
}
/*bildspel*/
.carousel {
height: 1000px;
margin-bottom: 70px;
}
.carousel-caption {
z-index: 10;
}
.carousel .item {
height: 1000px;
background-color: #777;
}
.carousel-inner > .item > img {
position: absolute;
top: 0;
left: 0;
min-width: 100%;
height: 1000px;
}
/*textstorlek.*/
.carousel-caption p {
margin-bottom: 20px;
font-size: 21px;
line-height: 1.4;
}
.carousel-caption i {
margin-bottom: 20px;
font-size: 21px;
line-height: 1.4;
}
/*Mer utrymme mellan bilderna.*/
.featurette-divider {
margin: 80px 0;
}
/* scrollUp */
#scrollUp {
bottom: 20px;
right: 20px;
padding: 10px 20px;
background: #555;
color: #fff;
}
/*Google maps*/
.google-maps {
position: relative;
padding-bottom: 75%;
height: 0;
overflow: hidden;
}
.google-maps iframe {
position: absolute;
top: 0;
left: 0;
width: 100% !important;
height: 100% !important;
border: 0;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<nav class="navbar navbar-default navbar-static-top">
<div class="container">
<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>
<a class="navbar-brand">Screen Brodyr i Kristianstad AB</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="active">Om oss
</li>
<li>Textiltryck
</li>
<li>Transfertryck
</li>
<li>Brodyr
</li>
<li>Digitaltryck
</li>
<li>Tampotryck
</li>
<li><a data-toggle="modal" data-target="#kontaktoss">Kontakt</a>
</li>
</ul>
</div>
</div>
</nav>
<!--Navigeringsfält slut.-->
<!--bildspel-->
<div id="bildspel" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-slide-to="0" class="active"></li>
<li data-target="#bildspel" data-slide-to="1"></li>
<li data-target="#bildspel" data-slide-to="2"></li>
</ol>
<div class="carousel-inner" role="listbox">
<div class="item active">
<img class="first-slide" src="http://edslab.esy.es/Screen-Brodyr-AB-master/image/lokal.jpg" alt="Lokal">
<div class="container">
<div class="carousel-caption">
<h1>Välkommen till Screen Brodyr i Kristianstad AB!</h1>
<p>
Vi bygger webbplats mer information kommer inom kort!</p>
<p>
</div>
</div>
</div>
<div class="item">
<img class="second-slide" src="http://edslab.esy.es/Screen-Brodyr-AB-master/image/lokal2.jpg" alt="Maskin">
<div class="container">
<div class="carousel-caption">
<h1>
Vi bygger webbplats mer information kommer inom kort!</h1>
<p>
Vi bygger webbplats mer information kommer inom kort!</p>
</div>
</div>
</div>
<div class="item">
<img class="third-slide" src="image/lokal2.jpg" alt="lokal2">
<div class="container">
<div class="carousel-caption">
<h1>
Vi bygger webbplats mer information kommer inom kort!</h1>
<p>
Vi bygger webbplats mer information kommer inom kort!</p>
</div>
</div>
</div>
</div>
<a class="left carousel-control" href="#bildspel" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#bildspel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
remove the height
.carousel-inner > .item > img {
position: absolute;
top: 0;
left: 0;
min-width: 100%;
//height: 1000px;
}
Hi I understand your problem is that when you open your website in mobile image size is to much large to go down we have to scroll more so use Bootstrap's class .img-responsive
you can try in this way
<img class="first-slide img-responsive" src="http://edslab.esy.es/Screen-Brodyr-AB-master/image/lokal.jpg" alt="Lokal">
and the height of the slider is bigger so make smaller in size it will help u in making responsive or don't give any height to div and image use its own height of image.
Related
This is my first attempt on creating a bootstrap menu, and I am stuck on the following issues. I tried different solutions suggested on similar questions, but with no success ☹
When collapsed I want the text: This is a Button to next to the button “button1”.
I’ve tried playing around with inline styling but I cannot get the 2 elements to stay on one line.
If I manage to display them on the same line, how do I make the text element to have the same left margin as the dropdown element below when collapsed?
I am not sure why the text & button element do not have the same left-margin as the dropdown below them.
Here is a copy of my code: https://jsfiddle.net/b512zesq/
thanks!
.navbar {
min-height: 80px;
background: #ee4035;
border-width: 0px;
border-radius: 0px;
color: blue;
}
.navbar a {
color: white!important;
}
.navbar-brand {
padding: 0 15px;
height: 80px;
line-height: 80px;
color: white;
}
.navbar-toggle {
/* (80px - button height 34px) / 2 = 23px */
margin-top: 23px;
padding: 9px 10px !important;
}
.navbar-btn {
/* (80px - button height 34px) / 2 = 23px */
margin-top: 18px;
margin-right: 30px;
padding: 9px 9;
background: #f37736;
border-width: 0px;
height: 35px;
width: 150px;
}
.navbar-text {
margin-top: 28px;
color: white;
}
.nav.navbar-nav.navbar-right li a {
color: white;
}
.dropdown-menu {
background: #ee4035;
}
.dropdown-menu>li>a:hover,
.dropdown-menu>li>a:focus {
background-color: #d6392f;
}
.navbar-default .navbar-nav>li>a:hover,
.navbar-default .navbar-nav>li>a:focus {
color: #ffffff;
}
.navbar-default .navbar-nav>li>.dropdown-menu {
background-color: #ee4035;
}
.navbar-default .navbar-nav>li>.dropdown-menu>li>a {
color: #ffffff;
}
.bar-nav>li>.dropdown-menu>li>a:hover,
.navbar-default .navbar-nav>li>.dropdown-menu>li>a:focus {
color: #ffffff;
background-color: #d6392f;
}
.navbar-default .navbar-nav>li>.dropdown-menu>li>.divider {
background-color: blue;
}
.navbar-default .navbar-nav>.active>a,
.navbar-default .navbar-nav>.active>a:hover,
.navbar-default .navbar-nav>.active>a:focus {
color: #ffffff;
background-color: #d6392f;
}
.navbar-default .navbar-nav>.open>a,
.navbar-default .navbar-nav>.open>a:hover,
.navbar-default .navbar-nav>.open>a:focus {
color: #ffffff;
background-color: #d6392f;
}
.navbar-default .navbar-toggle {
border-color: #d6392f;
}
.navbar-default .navbar-toggle:hover,
.navbar-default .navbar-toggle:focus {
background-color: #d6392f;
}
.navbar-default .navbar-toggle .icon-bar {
background-color: #ffffff;
}
.navbar-default .navbar-collapse,
.navbar-default .navbar-form {
border-color: #ffffff;
}
.navbar-default .navbar-link {
color: #ffffff;
}
.navbar-default .navbar-link:hover {
color: #ffffff;
}
/*RESPONSIVE*************************************************/
#media (min-width: 768px) {
.navbar-nav>li>a {
/* (80px - line-height of 27px) / 2 = 26.5px */
padding-top: 26.5px;
padding-bottom: 26.5px;
line-height: 27px;
}
}
/**END OF RESPONSIVE********************************************/
<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.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">logo</a>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav navbar-right">
<li class="inline"><span class="navbar-text" style="color:white"><strong>this is a button</strong></span></li>
<li><a class="btn btn-danger navbar-btn" href="{$rlBase}/add-listing.html" role="button">button 1</a></li>
<form class="navbar-form navbar-left" style="padding:0px; border-top-width:0px;"></form>
<li class="dropdown">
<a class="dropdown-toggle" id="user-navbar" data-toggle="dropdown" href="{$rlBase}/login.html"><span class="glyphicon glyphicon-user"></span> USERNAME<span class="caret"></a>
</div>
</div>
</nav>
You could style your parent <ul> with display: inline-flex and put the list-item with your dropdown outside of it. That could cause compatibility issues, however.
Just give your list item a padding-left of 15px. The dropdown link has a default padding-left of 15px (you can find that in the navs.less file on line 23).
I am having trouble adding padding to the left and right side of the nav bar so the social media buttons and the rest of the menu items are pushed closer towards the center. I tried adding padding to the left and right. However, that moves the position of the button that appears when the menu is collapsed. I have a logo in the center of the nav bar and then social media icons to the right and other menu items the left.
.navbar.navbar-default {
background-color: #ccc;
border-color: #ffffff;
padding-top:15px;
padding-bottom:15px;
}
.navbar.navbar-default .navbar-brand {
color: #292929;
}
.navbar.navbar-default .navbar-brand:hover,
.navbar.navbar-default .navbar-brand:focus {
color: #FC9F9F;
}
.navbar.navbar-default .navbar-text {
color: #292929;
}
.navbar.navbar-default .navbar-nav > li > a {
color: #292929;
}
.navbar.navbar-default .navbar-nav > li > a:hover,
.navbar.navbar-default .navbar-nav > li > a:focus {
color: #FC9F9F;
}
.navbar.navbar-default .navbar-nav > .active > a,
.navbar.navbar-default .navbar-nav > .active > a:hover,
.navbar.navbar-default .navbar-nav > .active > a:focus {
color: #FC9F9F;
background-color: #ffffff;
}
.navbar.navbar-default .navbar-nav > .open > a,
.navbar.navbar-default .navbar-nav > .open > a:hover,
.navbar.navbar-default .navbar-nav > .open > a:focus {
color: #FC9F9F;
background-color: #ffffff;
}
.navbar.navbar-default .navbar-toggle {
border-color: #ffffff;
}
.navbar.navbar-default .navbar-toggle:hover,
.navbar.navbar-default .navbar-toggle:focus {
background-color: #ffffff;
}
.navbar.navbar-default .navbar-toggle .icon-bar {
background-color: #292929;
}
.navbar.navbar-default .navbar-collapse,
.navbar.navbar-default .navbar-form {
border:none;
}
.navbar.navbar-default .navbar-link {
color: #292929;
}
.navbar.navbar-default .navbar-link:hover {
color: #ffd4d4;
}
.navbar-brand {
transform: translateX(-50%);
left: 50%;
position: absolute;
}
.nav.navbar-nav > li.navbar-left {
font-family: 'Nunito Sans', sans-serif;
font-size: 11.5px;
}
.navbar-brand {
padding: 10px;
}
.navbar-brand>img {
height: 30px;
width: auto;
}
#media (min-width: 768px) {
.navbar-brand { display: block; }
.navbar-bar-default .navbar-toggle {text-align: left;}
}
#media (min-width: 468px) {
.navbar-brand { display: block; }
.navbar-bar-default .navbar-toggle {text-align: left;}
}
.fa.fa-instagram {
font-size: 18px;
}
.fa.fa-pinterest {
font-size: 18px;
}
.fa.fa-facebook {
font-size: 18px;
}
.fa.fa-twitter{
font-size: 18px;
}
.banner {
width: 100%;
}
.banner-inner {
max-width:1100px;
margin: 0 auto;
}
#media (min-width:468px) and (max-width:991px){
.container.navbar-container {
width:100%;
padding:0px;
}
}
#media (min-width:768px) and (max-width:1024px){
.container.navbar-container {
width:100%;
padding:0px;
}
}
body { padding-top: 90px; }
#media screen (min-width: 468px) and (max-width: 768px) {
body { padding-top: 0px; }
}
.banner-inner>img {
opacity:0;
-moz-transition: opacity 2s; /* Firefox 4 */
-webkit-transition: opacity 2s; /* Safari and Chrome */
-o-transition: opacity 2s;
transition: opacity 2s;
}
.col-1-1> img{
opacity:0;
-moz-transition: opacity 2s; /* Firefox 4 */
-webkit-transition: opacity 2s; /* Safari and Chrome */
-o-transition: opacity 2s;
transition: opacity 2s;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device=width, initial-scale=1.0">
<title>J</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="css/style.css" />
<link href="css/sticky-footer.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Nunito|Nunito+Sans|Playfair+Display" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
</head>
<body style="padding-top: 70px;">
<header>
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">
<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="http://"><img class= "logo" src="img/logo.png"></a>
</div>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="navbar-left">TRAVEL</li>
<li class="navbar-left"> PORTFOLIO </li>
<li class="navbar-left"> ABOUT </li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="right"> <i class="fa fa-instagram"></i>
<li class="right"> <i class="fa fa-pinterest"></i>
<li class="right"> <i class="fa fa-facebook"></i>
<li class="right"> <i class="fa fa-twitter"></i>
</ul>
</div>
<!--/.nav-collapse -->
</div>
<!--/.container-fluid -->
</nav>
</div>
</div>
</header>
<!---End Header-->
<section class="banner">
<div class="banner-inner">
<img onload="this.style.opacity='1';" class="banner" src="img/background.png">
</div>
</section>
<!---End Banner-->
<!-- Begin page content -->
<footer class="footer">
<div class="container">
<span class>Copyright © 2017. All rights reserved.</span>
</div>
</footer>
<!---End Footer-->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
</body>
</html>
Use media queries. like this:
#media screen and (min-width:768px){
.navbar.navbar-default {
padding-left:40px;
padding-right:40px;
}
}
This will add padding to your navbar only if the screen size is more than 768px.
.navbar.navbar-default {
background-color: #ccc;
border-color: #ffffff;
padding-top:15px;
padding-bottom:15px;
}
#media screen and (min-width:768px){
.navbar.navbar-default {
padding-left:40px;
padding-right:40px;
}
}
.navbar.navbar-default .navbar-brand {
color: #292929;
}
.navbar.navbar-default .navbar-brand:hover,
.navbar.navbar-default .navbar-brand:focus {
color: #FC9F9F;
}
.navbar.navbar-default .navbar-text {
color: #292929;
}
.navbar.navbar-default .navbar-nav > li > a {
color: #292929;
}
.navbar.navbar-default .navbar-nav > li > a:hover,
.navbar.navbar-default .navbar-nav > li > a:focus {
color: #FC9F9F;
}
.navbar.navbar-default .navbar-nav > .active > a,
.navbar.navbar-default .navbar-nav > .active > a:hover,
.navbar.navbar-default .navbar-nav > .active > a:focus {
color: #FC9F9F;
background-color: #ffffff;
}
.navbar.navbar-default .navbar-nav > .open > a,
.navbar.navbar-default .navbar-nav > .open > a:hover,
.navbar.navbar-default .navbar-nav > .open > a:focus {
color: #FC9F9F;
background-color: #ffffff;
}
.navbar.navbar-default .navbar-toggle {
border-color: #ffffff;
}
.navbar.navbar-default .navbar-toggle:hover,
.navbar.navbar-default .navbar-toggle:focus {
background-color: #ffffff;
}
.navbar.navbar-default .navbar-toggle .icon-bar {
background-color: #292929;
}
.navbar.navbar-default .navbar-collapse,
.navbar.navbar-default .navbar-form {
border:none;
}
.navbar.navbar-default .navbar-link {
color: #292929;
}
.navbar.navbar-default .navbar-link:hover {
color: #ffd4d4;
}
.navbar-brand {
transform: translateX(-50%);
left: 50%;
position: absolute;
}
.nav.navbar-nav > li.navbar-left {
font-family: 'Nunito Sans', sans-serif;
font-size: 11.5px;
}
.navbar-brand {
padding: 10px;
}
.navbar-brand>img {
height: 30px;
width: auto;
}
#media (min-width: 768px) {
.navbar-brand { display: block; }
.navbar-bar-default .navbar-toggle {text-align: left;}
}
#media (min-width: 468px) {
.navbar-brand { display: block; }
.navbar-bar-default .navbar-toggle {text-align: left;}
}
.fa.fa-instagram {
font-size: 18px;
}
.fa.fa-pinterest {
font-size: 18px;
}
.fa.fa-facebook {
font-size: 18px;
}
.fa.fa-twitter{
font-size: 18px;
}
.banner {
width: 100%;
}
.banner-inner {
max-width:1100px;
margin: 0 auto;
}
#media (min-width:468px) and (max-width:991px){
.container.navbar-container {
width:100%;
padding:0px;
}
}
#media (min-width:768px) and (max-width:1024px){
.container.navbar-container {
width:100%;
padding:0px;
}
}
body { padding-top: 90px; }
#media screen (min-width: 468px) and (max-width: 768px) {
body { padding-top: 0px; }
}
.banner-inner>img {
opacity:0;
-moz-transition: opacity 2s; /* Firefox 4 */
-webkit-transition: opacity 2s; /* Safari and Chrome */
-o-transition: opacity 2s;
transition: opacity 2s;
}
.col-1-1> img{
opacity:0;
-moz-transition: opacity 2s; /* Firefox 4 */
-webkit-transition: opacity 2s; /* Safari and Chrome */
-o-transition: opacity 2s;
transition: opacity 2s;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device=width, initial-scale=1.0">
<title>J</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="css/style.css" />
<link href="css/sticky-footer.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Nunito|Nunito+Sans|Playfair+Display" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
</head>
<body style="padding-top: 70px;">
<header>
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">
<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="http://"><img class= "logo" src="img/logo.png"></a>
</div>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="navbar-left">TRAVEL</li>
<li class="navbar-left"> PORTFOLIO </li>
<li class="navbar-left"> ABOUT </li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="right"> <i class="fa fa-instagram"></i>
<li class="right"> <i class="fa fa-pinterest"></i>
<li class="right"> <i class="fa fa-facebook"></i>
<li class="right"> <i class="fa fa-twitter"></i>
</ul>
</div>
<!--/.nav-collapse -->
</div>
<!--/.container-fluid -->
</nav>
</div>
</div>
</header>
<!---End Header-->
<section class="banner">
<div class="banner-inner">
<img onload="this.style.opacity='1';" class="banner" src="img/background.png">
</div>
</section>
<!---End Banner-->
<!-- Begin page content -->
<footer class="footer">
<div class="container">
<span class>Copyright © 2017. All rights reserved.</span>
</div>
</footer>
<!---End Footer-->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
</body>
</html>
In this site, I have this navbar:
picture of the site before
Then, I decided to use the affix bootstrap thing in the navbar, so the user would be able to access it's functions while scrolling down the page. But then, that happened: picture with the affix pluggin
Keeping it simple, the navbar was swallowed by the carousel when I added data-spy="affix" to the tag <nav id="main-navbar" class="navbar navbar-default">. Its important to notice that, once in this position, its fixed in the window as you scroll the page, but not the way it should. And as I can't post any more link, nor can I embed Images, because I'm a noob, I'll just say that it keeps the same position relative to the browser window and the carousel controls stopped working.
This is the html code in body:
<body bgcolor="#f9ffe5">
<div id="main-div" class="container">
<div class="title"> <!--------------------title-------------------->
<div class="logo"><img src="img/logo-big.png" class="img img-responsive logo" /></div>
<br>
<button class="btn btn-success btn-lg btn-Fale-Conosco">Fale Conosco!</button>
</div>
<nav id="main-navbar" class="navbar navbar-default" data-spy="affix"><!-------navbar------->
<div class="navbar-header">
<a class="navbar-brand logo" href="#">
<div class="input-group stylish-input-group">
<input type="text" class="form-control" placeholder="Search">
<span class="input-group-addon">
<button type="submit">
<span class="glyphicon glyphicon-search"></span>
</button>
</span>
</div>
</a>
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#titleNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse" id="titleNavbar">
<ul class="nav navbar-nav">
<li class="active">Home</li>
<li>Empresa</li>
<li>Produtos <span class="glyphicon glyphicon-cutlery"></span></li>
<li>Trabalhe Conosco</li>
</ul>
</div>
</nav>
<div id="home-page-carousel" class="carousel slide" data-ride="carousel"><!-------carousel------>
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#homePageCarousel" data-slide-to="0" class="active"></li>
<li data-target="#homePageCarousel" data-slide-to="1"></li>
<li data-target="#homePageCarousel" data-slide-to="2"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img class="img-responsive center-block" src="img/carousel/0.jpg" alt="Produtos reforçados em cores variadas e design moderno!">
</div>
<div class="item">
<img class="img-responsive center-block" src="img/carousel/1.jpg" alt="Fabricamos produtos descartaveis! Atendemos e entregamos em todo o Brasil!">
</div>
<div class="item">
<img class="img-responsive center-block" src="img/carousel/2.jpg" alt="Consulte disponibilidade de produtos para pronta entrega! Pagamento facilitado!">
</div>
</div>
<!-- Left and right controls -->
<a class="left carousel-control" href="#homePageCarousel" role="button" data-slide="prev"> <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span> <span class="sr-only">Anterior</span> </a>
<a class="right carousel-control" href="#homePageCarousel" role="button" data-slide="next"> <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span> <span class="sr-only">Próximo</span> </a>
</div>
<div class="row centered-row catalog"> <!------catalog(prototype)------->
<div class="col-md-3 col-sm-4 col-xs-6 catalog-item">
<img src="img/products/taca_45_vrm.jpg" class="img-circle img-responsive img-catalog" alt="Taça 45ml">
<h3>Taça 45 ml</h3>
</div>
<div class="col-md-3 col-sm-4 col-xs-6 catalog-item">
<img src="img/products/copo_45_azc.jpg" class="img-circle img-responsive img-catalog" alt="Copo 45ml">
<h3>Copo 45 ml</h3>
</div>
<div class="col-md-3 col-sm-4 col-xs-6 catalog-item">
<img src="img/products/garfo_ref_prt.jpg" class="img-circle img-responsive img-catalog" alt="Garfo Refeição Reforçado">
<h3>Garfo Refeição Reforçado</h3>
</div>
</div>
</div>
Then, the ccs for the custom bootstrap navbar:
.navbar-default {
background-color: #1ba30b;
border-color: #006310;
z-index: 1;
}
.navbar-default .navbar-brand {
color: #ecf0f1;
}
.navbar-default .navbar-brand:hover,
.navbar-default .navbar-brand:focus {
color: #ffffff;
}
.navbar-default .navbar-text {
color: #ecf0f1;
}
.navbar-default .navbar-nav > li > a {
color: #ecf0f1;
}
.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus {
color: #ffffff;
background-color: green;
}
.navbar-default .navbar-nav > li > .dropdown-menu {
background-color: #1ba30b;
}
.navbar-default .navbar-nav > li > .dropdown-menu > li > a {
color: #ecf0f1;
}
.navbar-default .navbar-nav > li > .dropdown-menu > li > a:hover,
.navbar-default .navbar-nav > li > .dropdown-menu > li > a:focus {
color: #ffffff;
background-color: #006310;
}
.navbar-default .navbar-nav > li > .dropdown-menu > li > .divider {
background-color: #006310;
}
.navbar-default .navbar-nav .open .dropdown-menu > .active > a,
.navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,
.navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {
color: #ffffff;
background-color: #006310;
}
.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus {
color: #ffffff;
background-color: #006310;
}
.navbar-default .navbar-nav > .open > a,
.navbar-default .navbar-nav > .open > a:hover,
.navbar-default .navbar-nav > .open > a:focus {
color: #ffffff;
background-color: #006310;
}
.navbar-default .navbar-toggle {
border-color: #006310;
}
.navbar-default .navbar-toggle:hover,
.navbar-default .navbar-toggle:focus {
background-color: #006310;
}
.navbar-default .navbar-toggle .icon-bar {
background-color: #ecf0f1;
}
.navbar-default .navbar-collapse,
.navbar-default .navbar-form {
border-color: #ecf0f1;
}
.navbar-default .navbar-link {
color: #ecf0f1;
}
.navbar-default .navbar-link:hover {
color: #ffffff;
}
#media (max-width: 767px) {
.navbar-default .navbar-nav .open .dropdown-menu > li > a {
color: #ecf0f1;
}
.navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,
.navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
color: #ffffff;
}
.navbar-default .navbar-nav .open .dropdown-menu > .active > a,
.navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,
.navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {
color: #ffffff;
background-color: #006310;
}
}
And the css for the custom bootstrap carousel
.carousel .carousel-indicators li{
background-color: transparent;
border-color: forestgreen;
}
.carousel .carousel-indicators li.active{
background-color: forestgreen;
border-color: transparent;
}
.centered-row{
text-align: center;
}
.carousel{
-moz-border-radius: 10px; /* FF1+ */
-webkit-border-radius: 10px; /* Saf3-4, iOS 1+, Android 1.5+ */
border-radius: 10px; /* Opera 10.5, IE9, Saf5, Chrome, FF4 */
overflow:hidden;
z-index: 1000;
}
.carousel-control .glyphicon-triangle-right,
.carousel-control .glyphicon-triangle-left {
display: inline-block;
position: absolute;
top: 50%;
z-index: 5;
}
.glyphicon-chevron-left,
.glyphicon-chevron-right {
color:forestgreen;
vertical-align: middle;
}
Finally the css for the custom search input:
.stylish-input-group .input-group-addon{
background: white !important;
}
.stylish-input-group .form-control{
border-right:0;
box-shadow:0 0 0;
border-color:#ccc;
}
.stylish-input-group button{
border:0;
background:transparent;
}
div.stylish-input-group{
max-width: 187px;
}
I've tried a bunch of different stuff already. I didn't find similar cases also. But I hope it's something simple. Here are some things that I have tried already and didn't work:
wrap <nav> and <div class="carousel slide"> in one more layer of separated <div> tags
change the position property in css
put ids in both, to solve some sort of JavaScript problem with bootstrap.
If your answer is related to one of the above, fear not, it may be slightly different. Also, didn't use the snippet thing because bootstrap wasn't working.
Your navbar z-index value should be higher than the carousel's one.
You also need to give properties to your affix classes :
You must add CSS properties to handle the actual positions, with the exception of position:fixed on the .affix class.
Adding this in your CSS should fix your problems :
navbar.affix{
/* values related to your affixed navbar position (for example, top: 0;) */
z-index: 10000;
}
Have a nice day.
I have a Bootstrap Fixed responsive Navigation Bar with an image on the left of the buttons. I used media queries to make the spacing responsive and now I have this code:
My CSS:
.nav > li > a:hover
{
background-color: #FCC;
}
.navbar-header
{
float: right;
}
.navbar-default
{
background-color: #00b5fe;
border-color: #0089ff;
}
.navbar-default .navbar-brand
{
color: #ffffff;
}
.navbar-default .navbar-brand:hover, .navbar-default .navbar-brand:focus
{
color: #ffffff;
}
.navbar-default .navbar-text
{
color: #ffffff;
}
.navbar-default .navbar-nav > li > a
{
color: #ffffff;
}
.navbar-default .navbar-nav > li > a:hover, .navbar-default .navbar-nav > li > a:focus
{
color: #ffffff;
}
.navbar-default .navbar-nav > li > .dropdown-menu
{
background-color: #00b5fe;
}
.navbar-default .navbar-nav > li > .dropdown-menu > li > a
{
color: #ffffff;
}
.navbar-default .navbar-nav > li > .dropdown-menu > li > a:hover,
.navbar-default .navbar-nav > li > .dropdown-menu > li > a:focus
{
background-color: #0089ff;
color: #ffffff;
}
.navbar-default .navbar-nav > li > .dropdown-menu > li > .divider
{
background-color: #00b5fe;
}
.navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:hover, .navbar-default .navbar-nav > .active > a:focus
{
background-color: #0089ff;
color: #ffffff;
}
.navbar-default .navbar-nav > .open > a, .navbar-default .navbar-nav > .open > a:hover, .navbar-default .navbar-nav > .open > a:focus
{
background-color: #0089ff;
color: #ffffff;
}
.navbar-default .navbar-toggle
{
border-color: #0089ff;
}
.navbar-default .navbar-toggle:hover, .navbar-default .navbar-toggle:focus
{
background-color: #0089ff;
}
.navbar-default .navbar-toggle .icon-bar
{
background-color: #ffffff;
}
.navbar-default .navbar-collapse,
.navbar-default .navbar-form
{
border-color: #ffffff;
}
.navbar-default .navbar-link
{
color: #ffffff;
}
.navbar-default .navbar-link:hover
{
color: #ffffff;
}
#media (max-width: 767px)
{
.navbar-default .navbar-nav .open .dropdown-menu > li > a
{
color: #ffffff;
}
.navbar-default .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus
{
color: #ffffff;
}
.navbar-default .navbar-nav .open .dropdown-menu > .active > a, .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus
{
background-color: #0089ff;
color: #ffffff;
}
}
#media (min-width: 767px)
{
body
{
padding-top: 230px;
}
}
#media (max-width: 767px)
{
body
{
padding-top: 130px;
}
}
#media (min-width: 768px)
{
#resize
{
width: 30%;
}
}
#media (min-width: 768px)
{
#alignp
{
text-align: center;
}
}
And My HTML:
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<nav class="navbar navbar-default navbar-inverse navbar-fixed-top" id="navbar-blue">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span>
</button>
</div>
<p></p>
<p id="centerp">
<img align="left" id="resize" width="60%" src="../logo.png" alt="Coding Kids" style="display:block; margin-left: auto; margin-right: auto; margin-bottom: 20px;">
</p>
<br />
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li><a></a></li>
<li class="active">Home
</li>
<li>About
</li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="/">Products<span class="caret"></span></a>
<ul class="dropdown-menu">
<li>Silver
</li>
<li>Silver+
</li>
<li>Gold
</li>
<li>Gold+
</li>
</ul>
</li>
<li>Contact
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><img src="images/register.png" width="20"> Sign Up
</li>
<li><img src="images/login.png" width="20"> Login
</li>
</ul>
</div>
</div>
</nav>
<div id="signUp" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Sign Up</h4>
</div>
<div class="modal-body">
<p>Sign Up Box Goes Here</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div id="logIn" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Login</h4>
</div>
<div class="modal-body">
<p>Login Box Goes Here</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div class="well">
{tag_pagecontent}
</div>
<div class="panel panel-default" style="background-color: black; clear: both;">
<div class="panel-body" style="background-color: black; color: white;">© Coding Kids</div>
</div>
A working version of this page is here.
As you can see in my working version, as you resize the window, the logo changes position. At the moment, it doesn't look very neat as it keeps changing position. All I want is for the logo to always be centred horizontally and vertically in the space it has. How would I go about editing my CSS and media queries to suit this?
Just changing the alignment should do the trick.
<img align="centre" id="resize" width="60%" src="../logo.png" alt="Coding Kids" style="display:block; margin-bottom:20px;>
If it doesn't try adding a div and settling the image in it:
<div align="centre"><img align="left" id="resize" width="60%" src="../logo.png" alt="Coding Kids" style="display:block; margin-left: auto; margin-right: auto; margin-bottom: 20px;"></div>
You can also use the
<div style="text-align:centre;">
CSS rule instead.
I'm new to css and i'm doing a simple project, I have put 2 navbars in my website. First navbar is the default one. The second one passes on top of that when I click a button in the 1st navbar. Due to poor configuration of the css file I have overridden the below one. Some links are not working (login link). How do I separate them. I used two examples to do this.
This is the css file.
The first Navbar
.navbar-default {
background-color: #022436;
border-color: #2b4156;
}
.navbar-default .navbar-brand {
color: #fdfdff;
}
.navbar-default .navbar-brand:hover, .navbar-default .navbar-brand:focus {
color: #029fe5;
}
.navbar-default .navbar-text {
color: #fdfdff;
}
.navbar-default .navbar-nav > li > a {
color: #fdfdff;
}
.navbar-default .navbar-nav > li > a:hover, .navbar-default .navbar-nav > li > a:focus {
color: #029fe5;
}
.navbar-default .navbar-nav > li > .dropdown-menu {
background-color: #022436;
}
.navbar-default .navbar-nav > li > .dropdown-menu > li > a {
color: #fdfdff;
}
.navbar-default .navbar-nav > li > .dropdown-menu > li > a:hover,
.navbar-default .navbar-nav > li > .dropdown-menu > li > a:focus {
color: #029fe5;
background-color: #2b4156;
}
.navbar-default .navbar-nav > li > .dropdown-menu > li > .divider {
background-color: #022436;
}
.navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:hover, .navbar-default .navbar-nav > .active > a:focus {
color: #029fe5;
background-color: #2b4156;
}
.navbar-default .navbar-nav > .open > a, .navbar-default .navbar-nav > .open > a:hover, .navbar-default .navbar-nav > .open > a:focus {
color: #029fe5;
background-color: #2b4156;
}
.navbar-default .navbar-toggle {
border-color: #2b4156;
}
.navbar-default .navbar-toggle:hover, .navbar-default .navbar-toggle:focus {
background-color: #2b4156;
}
.navbar-default .navbar-toggle .icon-bar {
background-color: #fdfdff;
}
.navbar-default .navbar-collapse,
.navbar-default .navbar-form {
border-color: #fdfdff;
}
.navbar-default .navbar-link {
color: #fdfdff;
}
.navbar-default .navbar-link:hover {
color: #029fe5;
}
#media (max-width: 767px) {
.navbar-default .navbar-nav .open .dropdown-menu > li > a {
color: #fdfdff;
}
.navbar-default .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
color: #029fe5;
}
.navbar-default .navbar-nav .open .dropdown-menu > .active > a, .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {
color: #029fe5;
background-color: #2b4156;
}
}
This is code is for the login css code
#login-dp{
min-width: 250px;
padding: 14px 14px 0;
overflow:hidden;
background-color:rgba(255,255,255,.8);
}
#login-dp .help-block{
font-size:12px
}
#login-dp .bottom{
background-color:rgba(255,255,255,.8);
border-top:1px solid #ddd;
clear:both;
padding:14px;
}
#login-dp .social-buttons{
margin:12px 0
}
#login-dp .social-buttons a{
width: 49%;
}
#login-dp .form-group {
margin-bottom: 10px;
}
.btn-fb{
color: #fff;
background-color:#3b5998;
}
.btn-fb:hover{
color: #fff;
background-color:#496ebc;
}
.btn-tw{
color: #fff;
background-color:#55acee;
}
.btn-tw:hover{
color: #fff;
background-color:#59b5fa;
}
#media(max-width:768px){
#login-dp{
background-color: inherit;
color: #fff;
}
#login-dp .bottom{
background-color: inherit;
border-top:0 none;
}
}
This is the 2nd navbar (drops over the 1st navabar when a button is cilcked)
.navbar-brand { position: relative; z-index: 2; }
.navbar-nav.navbar-left .btn { position: relative; z-index: 2; padding: 4px 20px; margin: 10px auto; transition: transform 0.3s; }
.navbar .navbar-collapse { position: relative; overflow: hidden !important; }
.navbar .navbar-collapse .navbar-left > li:last-child { padding-left: 100px; }
.navbar .nav-collapse { position: absolute; z-index: 1; top: 0; left: 0px; right: 0; bottom: 0; margin: 0; padding-right: 120px; padding-left: 80px; width: 50%; }
.navbar.navbar-default .nav-collapse { background-color: #f8f8f8; }
.navbar.navbar-inverse .nav-collapse { background-color: #222; }
.navbar .nav-collapse .navbar-form { border-width: 0; box-shadow: none; }
.nav-collapse>li { float: left; }
.btn.btn-circle { border-radius: 50px; }
.btn.btn-outline { background-color: transparent; }
.navbar-nav.navbar-left .btn:not(.collapsed) {
background-color: rgb(111, 84, 153);
border-color: rgb(111, 84, 153);
color: rgb(255, 255, 255);
}
.navbar.navbar-default .nav-collapse,
.navbar.navbar-inverse .nav-collapse {
height: auto !important;
transition: transform 0.3s;
transform: translate(0px,-50px);
}
.navbar.navbar-default .nav-collapse.in,
.navbar.navbar-inverse .nav-collapse.in {
transform: translate(0px,0px);
}
#media screen and (max-width: 767px) {
.navbar .navbar-collapse .navbar-left > li:last-child { padding-left: 15px; padding-right: 15px; }
.navbar .nav-collapse { margin: 7.5px auto; padding: 0; }
.navbar .nav-collapse .navbar-form { margin: 0; }
.nav-collapse>li { float: none; }
.navbar.navbar-default .nav-collapse,
.navbar.navbar-inverse .nav-collapse {
transform: translate(-100%,0px);
}
.navbar.navbar-default .nav-collapse.in,
.navbar.navbar-inverse .nav-collapse.in {
transform: translate(0px,0px);
}
.navbar.navbar-default .nav-collapse.slide-down,
.navbar.navbar-inverse .nav-collapse.slide-down {
transform: translate(0px,-100%);
}
.navbar.navbar-default .nav-collapse.in.slide-down,
.navbar.navbar-inverse .nav-collapse.in.slide-down {
transform: translate(0px,0px);
}
}
If I anyone can explain how do i separate them using names or numbers, that would be appreciated.
This are the navbars both are included in the header tags
<div class="navbar-header">
<a class="navbar-brand" href="#/">Web Name</a>
</div>
<div class="collapse navbar-collapse" id="navbar-collapse-1">
<ul class="nav navbar-nav navbar-left">
<li><span class="glyphicon glyphicon-home"> Home</span></li>
<li><span class="glyphicon glyphicon-star"> About us</span></li>
<li><span class="glyphicon glyphicon-phone-alt"> Contact us</span></li>
<li><a class="btn btn-default btn-outline btn-circle collapsed" data-toggle="collapse" href="#nav-collapse1" aria-expanded="false" aria-controls="nav-collapse1">Categories</a></li>
</ul>
<ul class="collapse nav navbar-nav nav-collapse" id="nav-collapse1"> <!--The 2nd Navbar-->
<li>Action 1</li>
<li>Action 2</li>
<li>Action 3</li>
<li>Action 4</li>
</ul>
<!--</div>-->
<ul class="nav navbar-nav navbar-right">
<li><span class="glyphicon glyphicon-user"> Sign up</span></li>
<li class="dropdown">
<span class="glyphicon glyphicon-log-in"></span> Log-in <b class="caret" style="color:white"></b>
<ul id="login-dp" class="dropdown-menu">
<li>
<div class="row">
<div class="col-md-12">
Login via,
<div class="social-buttons">
<i class="fa fa-facebook"> Facebook</i>
<i class="fa fa-twitter"> Twitter</i>
</div>
or
<form class="form" role="form" method="post" action="login" accept-charset="UTF-8" id="login-nav">
<div class="form-group">
<label class="sr-only" for="inputEmail">E-mail</label>
<input type="email" class="form-control" id="inputEmail" placeholder="E-mail address" required />
</div>
<div class="form-group">
<label class="sr-only" for="inputPassword">Password</label>
<input type="password" class="form-control" id="inputPassword" placeholder="Password" required />
<div class="help-block text-right">Forgot password?</div>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary btn-block"> Sign in </button>
</div>
<div class="checkbox">
<label>
<input type="checkbox" /> Keep me logged-in
</label>
</div>
</form>
</div>
</div>
</li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
Not really sure you meant 2nd navbar or a dropdown menu within the navbar. The way you build your navbar I'm assuming you want one navbar and a dropdown within that navbar.
Here's a working version http://plnkr.co/edit/EDogb0HQhRzqOlaLng7J
Hope this is what you're trying to achieve.
There are several things that are missing from your code.
I've added the button menu for mobile collapse all.
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
You want to insert the 2nd inside the first to create the dropdown.
<ul class="nav navbar-nav navbar-left">
<li>
<a href="#/">
<span class="glyphicon glyphicon-home"> Home</span>
</a>
</li>
<li>
<a href="#/about">
<span class="glyphicon glyphicon-star"> About us</span>
</a>
</li>
<li>
<a href="#/contact">
<span class="glyphicon glyphicon-phone-alt"> Contact us</span>
</a>
</li>
<li class="dropdown">
<a class="btn btn-default btn-outline btn-circle dropdown-toggle" role="button" data-toggle="dropdown" href="#" aria-haspopup="true" aria-expanded="false">Categories</a>
<ul class="dropdown-menu" id="nav-collapse2">
<!--The 2nd Navbar-->
<li>
Action 1
</li>
<li>
Action 2
</li>
<li>
Action 3
</li>
<li>
Action 4
</li>
</ul>
</li>
</ul>