I am having difficulty getting the logo image (red) to overflow the menu bar, currently the menu bar is extended once the logo is added (see the image).
The HTML Code:
<div id="page" class="page">
<div class="pixfort_normal_1" id="section_header_2_dark">
<div class="header_nav_1 dark pix_builder_bg" style="background-image: none; background-color: rgb(13, 52, 64); padding-top: 0px; padding-bottom: 0px; box-shadow: none; border-color: rgb(255, 255, 255); background-size: auto; background-attachment: scroll; background-repeat: repeat;">
<div class="container">
<div class="sixteen columns firas2">
<nav role="navigation" class="navbar navbar-white navbar-embossed navbar-lg pix_nav_1">
<div class="containerss">
<div class="navbar-header">
<button data-target="#navbar-collapse-02" data-toggle="collapse" class="navbar-toggle pix_text" type="button">
<span class="sr-only ">Toggle navigation</span>
</button>
<img src="images/LOGO1.png" class="pix_nav_logo">
</div>
<div id="navbar-collapse-02" class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<li class="active propClone">Home</li>
<li class="propClone">About</li>
<li class="propClone">Workshops and Training</li>
<li class="propClone">Contact</li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container -->
</nav>
</div>
</div><!-- container -->
</div>
</div>
The CSS Code:
.pix_nav_1 ul li a {
color: rgba(0, 0, 0, 0.5);
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-ms-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
};
.pix_nav_1 ul li a:hover {
//color: rgba(0,0,0,0.85);
opacity: 0.6;
}
.header_nav_1 {
padding: 0px !important;
box-shadow: none;
}
.pix_nav_logo {
background: url(../images/t_logo.png) no-repeat;
padding-top: 0px;
overflow: visible;
}
.navbar-center {margin-left: auto;margin-right: auto;float: none;position:
relative;text-align: center; }
.navbar-center li { text-align: center;float: none;display: inline-block;}
Could someone please assist me to how I can get the logo to overflow the menu. Thanks in advance!
Try this
.pix_nav_logo {
position: absolute;
}
You can adjust the logo by playing with different values for css property left and right for .pix_nav_logo.
position: absolute : The element is positioned relative to its first positioned (not static) ancestor element.
.pix_nav_logo {
background: url(../images/t_logo.png) no-repeat;
padding-top: 0px;
overflow: visible;
width: 100px; // This for your logo size
position: absolute; // This is absolute position of logo
}
.pix_nav_1 ul li a {
color: rgba(0, 0, 0, 0.5);
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-ms-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
}
;
.pix_nav_1 ul li a:hover {
//color: rgba(0,0,0,0.85);
opacity: 0.6;
}
.header_nav_1 {
padding: 0px !important;
box-shadow: none;
}
.pix_nav_logo {
background: url(../images/t_logo.png) no-repeat;
padding-top: 0px;
overflow: visible;
width: 100px;
position: absolute;
}
.navbar-center {
margin-left: auto;
margin-right: auto;
float: none;
position: relative;
text-align: center;
}
.navbar-center li {
text-align: center;
float: none;
display: inline-block;
}
<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>
<div id="page" class="page">
<div class="pixfort_normal_1" id="section_header_2_dark">
<div class="header_nav_1 dark pix_builder_bg" style="background-image: none; background-color: rgb(13, 52, 64); padding-top: 0px; padding-bottom: 0px; box-shadow: none; border-color: rgb(255, 255, 255); background-size: auto; background-attachment: scroll; background-repeat: repeat;">
<div class="container">
<div class="sixteen columns firas2">
<nav role="navigation" class="navbar navbar-white navbar-embossed navbar-lg pix_nav_1">
<div class="containerss">
<div class="navbar-header">
<button data-target="#navbar-collapse-02" data-toggle="collapse" class="navbar-toggle pix_text" type="button">
<span class="sr-only ">Toggle navigation</span>
</button>
<img src="http://www.hjmt.com/blog/wp-content/uploads/2012/08/Logo_TV_2015.png" class="pix_nav_logo">
</div>
<div id="navbar-collapse-02" class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<li class="active propClone">Home</li>
<li class="propClone">About</li>
<li class="propClone">Workshops and Training</li>
<li class="propClone">Contact</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>
</div>
</div>
<!-- container -->
</div>
</div>
Related
The issue that I'm having is that the content on my page is being pushed down by the navbar creating a small scroll gap at the bottom of the page.
I'd like to have all the content fill the page without the unnecessary scroll bar in the above image. The navbar at the top of the page is a basic Bootstrap navbar with the body making use of this code I copied from Bootsnipp consisting of a side navigation and content area, which I have modified and added a responsive toggle button.
The issue is being caused by applying position: absolute to #sidebar-wrapper which fixes the side nav to the top of the page. I have tried changing the order and positioning of the layout as well as placing the header-navbar and content inside of a wrapper with little success.
The above gif is the issue that I was having before applying position: absolute although this is only a temporary fix as when the window is resized vertically the side-nav doesn't stay fixed to the bottom of the page.
Below is a snippet of the view in question.
Thank you for your time and I will be happy to provide any further information if needed
var AccountNav = (function() {
var wWidth
$(document).ready(function() {
$('#submenu-toggle').click(function(e) {
e.preventDefault()
$('#wrapper').toggleClass('toggled')
})
getWindowWidth()
ToggleNavBar()
})
$(window).resize(function() {
getWindowWidth()
console.log(wWidth)
ToggleNavBar()
})
function ToggleNavBar() {
if (wWidth >= 768) {
$('#toggle-navbar').css("display", "none")
} else {
$('#toggle-navbar').css("display", "flex")
if ($('#wrapper').hasClass('toggled')) {
$('#wrapper').toggleClass('toggled')
}
}
}
function getWindowWidth() {
wWidth = $(window).width()
}
})();
html,
body {
overflow-x: hidden;
}
#wrapper {
padding-left: 0;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#wrapper.toggled {
padding-left: 250px;
}
#sidebar-wrapper {
z-index: 1000;
position: fixed;
left: 250px;
width: 0;
height: 100%;
margin-left: -250px;
overflow-y: auto;
background: #000;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#wrapper.toggled #sidebar-wrapper {
width: 250px;
}
#page-content-wrapper {
width: 100%;
position: absolute;
padding: 15px;
}
#wrapper.toggled #page-content-wrapper {
position: absolute;
margin-right: -250px;
}
/* Sidebar Styles */
.sidebar-nav {
position: absolute;
top: 0;
width: 250px;
margin: 0;
padding: 0;
list-style: none;
}
.sidebar-nav li {
text-indent: 20px;
line-height: 40px;
}
.sidebar-nav li a {
display: block;
text-decoration: none;
color: #999999;
}
.sidebar-nav li a:hover {
text-decoration: none;
color: #fff;
background: rgba(255, 255, 255, 0.2);
}
.sidebar-nav li a:active,
.sidebar-nav li a:focus {
text-decoration: none;
}
.sidebar-nav>.sidebar-brand {
height: 65px;
font-size: 18px;
line-height: 60px;
color: #fff
}
.sidebar-nav>.sidebar-brand a {
color: #999999;
}
.sidebar-nav>.sidebar-brand a:hover {
color: #fff;
background: none;
}
#media(min-width:768px) {
#wrapper {
padding-left: 250px;
}
#wrapper.toggled {
padding-left: 0;
}
#sidebar-wrapper {
width: 250px;
}
#wrapper.toggled #sidebar-wrapper {
width: 0;
}
#page-content-wrapper {
padding: 20px;
position: relative;
}
#wrapper.toggled #page-content-wrapper {
position: relative;
margin-right: 0;
}
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<body>
<header>
<nav class="navbar navbar-expand-md bg-dark navbar-dark py-1">
<div class="container">
<!-- Brand -->
<a asp-controller="home" asp-action="index" class="navbar-brand">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="32px" height="32px" viewBox="0 0 32 32" style=" enable-background: new 0 0 32 32;" xml:space="preserve" fill="white">
<g id="logo" class="logo">
<path d="M2 20h20v2H2v-2zm2-8h2v7H4v-7zm5 0h2v7H9v-7zm4 0h2v7h-2v-7zm5 0h2v7h-2v-7zM2 7l10-5 10 5v4H2V7zm2 1.236V9h16v-.764l-8-4-8 4zM12 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2z" />
</g>
</svg> BankNet
</a>
<!-- Toggler/collapsibe Button -->
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="collapsibleNavbar">
<ul class="navbar-nav">
<li class="nav-item">
<a asp-controller="Home" asp-action="Index" class="nav-link">Home</a>
</li>
<li class="nav-item">
<a asp-controller="Home" asp-action="Features" class="nav-link">Features</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="false" aria-expanded="false">
Utilities
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<a asp-controller="Utilities" asp-action="CurrencyConverter" class="dropdown-item">Currency Converter</a>
<a asp-controller="Utilities" asp-action="TaxCalculator" class="dropdown-item">Tax Calculator</a>
</div>
</li>
</ul>
<ul class="navbar-nav ml-auto">
<li href="#" class="nav-link">
<a asp-controller="Account" asp-action="Account" class="nav-link">Account</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<main role="main" class="pb-3">
<nav class="navbar p-1" id="toggle-navbar">
<div class="nav-item">
<a class="btn btn-dark text-light" id="submenu-toggle">Toggle Menu</a>
</div>
</nav>
<div id="wrapper">
<div id="sidebar-wrapper" style="position:absolute">
<ul class="sidebar-nav">
<li class="sidebar-brand">
Hello {Name}
</li>
<li>
Accounts
</li>
<li>
Transfers
</li>
<li>
Loans
</li>
<li>
Account options
</li>
</ul>
</div>
<div id="page-content-wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<h1>Hello World</h1>
<h1>Hello World</h1>
<h1>Hello World</h1>
<h1>Hello World</h1>
<h1>Hello World</h1>
<h1>Hello World</h1>
<h1>Hello World</h1>
</div>
</div>
</div>
</div>
</div>
</main>
</body>
I've changed your navbar position css to fixed, i hope this is the solution that you are looking for
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous" />
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"
integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
crossorigin="anonymous"></script>
<body>
<header>
<nav class="navbar navbar--fixed navbar-expand-md bg-dark navbar-dark py-1">
<div class="container">
<!-- Brand -->
<a asp-controller="home" asp-action="index" class="navbar-brand">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
x="0px" y="0px" width="32px" height="32px" viewBox="0 0 32 32"
style="enable-background: new 0 0 32 32;" xml:space="preserve" fill="white">
<g id="logo" class="logo">
<path
d="M2 20h20v2H2v-2zm2-8h2v7H4v-7zm5 0h2v7H9v-7zm4 0h2v7h-2v-7zm5 0h2v7h-2v-7zM2 7l10-5 10 5v4H2V7zm2 1.236V9h16v-.764l-8-4-8 4zM12 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2z" />
</g>
</svg>
BankNet
</a>
<!-- Toggler/collapsibe Button -->
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="collapsibleNavbar">
<ul class="navbar-nav">
<li class="nav-item">
<a asp-controller="Home" asp-action="Index" class="nav-link">Home</a>
</li>
<li class="nav-item">
<a asp-controller="Home" asp-action="Features" class="nav-link">Features</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink"
data-toggle="dropdown" aria-haspopup="false" aria-expanded="false">
Utilities
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<a asp-controller="Utilities" asp-action="CurrencyConverter"
class="dropdown-item">Currency Converter</a>
<a asp-controller="Utilities" asp-action="TaxCalculator" class="dropdown-item">Tax
Calculator</a>
</div>
</li>
</ul>
<ul class="navbar-nav ml-auto">
<li href="#" class="nav-link">
<a asp-controller="Account" asp-action="Account" class="nav-link">Account</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<main role="main" class="pb-3">
<nav class="navbar p-1" id="toggle-navbar">
<div class="nav-item">
<a class="btn btn-dark text-light" id="submenu-toggle">Toggle Menu</a>
</div>
</nav>
<div id="wrapper">
<div id="sidebar-wrapper">
<ul class="sidebar-nav">
<li class="sidebar-brand">
Hello {Name}
</li>
<li>
Accounts
</li>
<li>
Transfers
</li>
<li>
Loans
</li>
</li>
<li>
Account options
</li>
</ul>
</div>
<div id="page-content-wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<h1>Hello World</h1>
<h1>Hello World</h1>
<h1>Hello World</h1>
<h1>Hello World</h1>
<h1>Hello World</h1>
<h1>Hello World</h1>
</div>
</div>
</div>
</div>
</div>
</main>
</body>
<style>
html,
body {
overflow-x: hidden;
}
.navbar--fixed {
position: fixed;
width: 100%;
z-index: 1100;
}
#toggle-navbar {
position: fixed;
height: 110px;
background: white;
z-index: 1050;
width: 100%;
}
#submenu-toggle {
margin-top: 64px;
}
#wrapper {
padding-left: 0;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#wrapper.toggled {
padding-left: 250px;
}
#sidebar-wrapper {
z-index: 1000;
position: fixed;
left: 250px;
width: 0;
overflow-x: hidden;
margin-left: -250px;
overflow-y: auto;
background: #000;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#wrapper.toggled #sidebar-wrapper {
width: 250px;
}
#page-content-wrapper {
width: 100%;
position: absolute;
padding: 15px;
}
#wrapper.toggled #page-content-wrapper {
position: absolute;
margin-right: -250px;
}
/* Sidebar Styles */
.sidebar-nav {
position: absolute;
top: 0;
width: 250px;
margin: 0;
padding: 0;
list-style: none;
}
.sidebar-nav li {
text-indent: 20px;
line-height: 40px;
}
.sidebar-nav li a {
display: block;
text-decoration: none;
color: #999999;
}
.sidebar-nav li a:hover {
text-decoration: none;
color: #fff;
background: rgba(255, 255, 255, 0.2);
}
.sidebar-nav li a:active,
.sidebar-nav li a:focus {
text-decoration: none;
}
.sidebar-nav>.sidebar-brand {
height: 65px;
font-size: 18px;
line-height: 60px;
color: #fff;
}
.sidebar-nav>.sidebar-brand a {
color: #999999;
}
.sidebar-nav>.sidebar-brand a:hover {
color: #fff;
background: none;
}
#media (max-width: 768px) {
#sidebar-wrapper {
height: calc(100vh - 110px);
margin-top: 110px;
}
.container-fluid {
margin-top: 110px;
}
}
#media (min-width: 768px) {
.sidebar-nav {
margin-top: 64px;
}
#wrapper {
padding-left: 250px;
}
#wrapper.toggled {
padding-left: 0;
}
#sidebar-wrapper {
width: 250px;
height: 100%;
}
#wrapper.toggled #sidebar-wrapper {
width: 0;
}
#page-content-wrapper {
padding: 20px;
position: relative;
}
#wrapper.toggled #page-content-wrapper {
position: relative;
margin-right: 0;
}
}
</style>
<script>
var AccountNav = (function () {
var wWidth;
$(document).ready(function () {
$("#submenu-toggle").click(function (e) {
e.preventDefault();
$("#wrapper").toggleClass("toggled");
});
getWindowWidth();
ToggleNavBar();
});
$(window).resize(function () {
getWindowWidth();
console.log(wWidth);
ToggleNavBar();
});
function ToggleNavBar() {
if (wWidth >= 768) {
$("#toggle-navbar").css("display", "none");
} else {
$("#toggle-navbar").css("display", "flex");
if ($("#wrapper").hasClass("toggled")) {
$("#wrapper").toggleClass("toggled");
}
}
}
function getWindowWidth() {
wWidth = $(window).width();
}
})();
</script>
The issue is caused by height: 100% for #sidebar-wrapper - we just reduce the height of #sidebar-wrapper by the height of the <header> which brings us to one change in your CSS:
height: calc(100% - 64px);
complete snippet below:
var AccountNav = (function() {
var wWidth;
$(document).ready(function() {
$("#submenu-toggle").click(function(e) {
e.preventDefault();
$("#wrapper").toggleClass("toggled");
});
getWindowWidth();
ToggleNavBar();
});
$(window).resize(function() {
getWindowWidth();
console.log(wWidth);
ToggleNavBar();
});
function ToggleNavBar() {
if (wWidth >= 768) {
$("#toggle-navbar").css("display", "none");
} else {
$("#toggle-navbar").css("display", "flex");
if ($("#wrapper").hasClass("toggled")) {
$("#wrapper").toggleClass("toggled");
}
}
}
function getWindowWidth() {
wWidth = $(window).width();
}
})();
html,
body {
overflow-x: hidden;
}
#wrapper {
padding-left: 0;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#wrapper.toggled {
padding-left: 250px;
}
#sidebar-wrapper {
z-index: 1000;
position: fixed;
left: 250px;
width: 0;
height: calc(100% - 64px);
margin-left: -250px;
overflow-y: auto;
background: #000;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#wrapper.toggled #sidebar-wrapper {
width: 250px;
}
#page-content-wrapper {
width: 100%;
position: absolute;
padding: 15px;
}
#wrapper.toggled #page-content-wrapper {
position: absolute;
margin-right: -250px;
}
/* Sidebar Styles */
.sidebar-nav {
position: absolute;
top: 0;
width: 250px;
margin: 0;
padding: 0;
list-style: none;
}
.sidebar-nav li {
text-indent: 20px;
line-height: 40px;
}
.sidebar-nav li a {
display: block;
text-decoration: none;
color: #999999;
}
.sidebar-nav li a:hover {
text-decoration: none;
color: #fff;
background: rgba(255, 255, 255, 0.2);
}
.sidebar-nav li a:active,
.sidebar-nav li a:focus {
text-decoration: none;
}
.sidebar-nav>.sidebar-brand {
height: 65px;
font-size: 18px;
line-height: 60px;
color: #fff
}
.sidebar-nav>.sidebar-brand a {
color: #999999;
}
.sidebar-nav>.sidebar-brand a:hover {
color: #fff;
background: none;
}
#media(min-width:768px) {
#wrapper {
padding-left: 250px;
}
#wrapper.toggled {
padding-left: 0;
}
#sidebar-wrapper {
width: 250px;
}
#wrapper.toggled #sidebar-wrapper {
width: 0;
}
#page-content-wrapper {
padding: 20px;
position: relative;
}
#wrapper.toggled #page-content-wrapper {
position: relative;
margin-right: 0;
}
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous" />
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<body>
<header>
<nav class="navbar navbar--fixed navbar-expand-md bg-dark navbar-dark py-1">
<div class="container">
<!-- Brand -->
<a asp-controller="home" asp-action="index" class="navbar-brand">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="32px" height="32px" viewBox="0 0 32 32" style="enable-background: new 0 0 32 32;" xml:space="preserve" fill="white">
<g id="logo" class="logo">
<path
d="M2 20h20v2H2v-2zm2-8h2v7H4v-7zm5 0h2v7H9v-7zm4 0h2v7h-2v-7zm5 0h2v7h-2v-7zM2 7l10-5 10 5v4H2V7zm2 1.236V9h16v-.764l-8-4-8 4zM12 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2z" />
</g>
</svg> BankNet
</a>
<!-- Toggler/collapsibe Button -->
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="collapsibleNavbar">
<ul class="navbar-nav">
<li class="nav-item">
<a asp-controller="Home" asp-action="Index" class="nav-link">Home</a>
</li>
<li class="nav-item">
<a asp-controller="Home" asp-action="Features" class="nav-link">Features</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="false" aria-expanded="false">
Utilities
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<a asp-controller="Utilities" asp-action="CurrencyConverter" class="dropdown-item">Currency Converter</a>
<a asp-controller="Utilities" asp-action="TaxCalculator" class="dropdown-item">Tax
Calculator</a>
</div>
</li>
</ul>
<ul class="navbar-nav ml-auto">
<li href="#" class="nav-link">
<a asp-controller="Account" asp-action="Account" class="nav-link">Account</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<main role="main" class="pb-3">
<nav class="navbar p-1" id="toggle-navbar">
<div class="nav-item">
<a class="btn btn-dark text-light" id="submenu-toggle">Toggle Menu</a>
</div>
</nav>
<div id="wrapper">
<div id="sidebar-wrapper">
<ul class="sidebar-nav">
<li class="sidebar-brand">
Hello {Name}
</li>
<li>
Accounts
</li>
<li>
Transfers
</li>
<li>
Loans
</li>
</li>
<li>
Account options
</li>
</ul>
</div>
<div id="page-content-wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<h1>Hello World</h1>
<h1>Hello World</h1>
<h1>Hello World</h1>
<h1>Hello World</h1>
<h1>Hello World</h1>
<h1>Hello World</h1>
</div>
</div>
</div>
</div>
</div>
</main>
</body>
I want to create a navbar over an tranparent background but when I create navbar it also gets the properties of background image. Can anyone please help me solve this problem?
This is the HTML for the Menu:
<section>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<img src="logo.png" style="padding-left: 50px; margin-top: 5%">
</div>
<ul class="nav navbar-nav navbar-right">
<li class="active"> HOME</li>
<li> SERVICES</li>
<li> ABOUT</li>
<li> TESTIMONIALS</li>
<li> CONTACT</li>
</ul>
</div>
</nav>
</section>
And here is the CSS:
.navbar {
background:transparent;
background-image:none;
border-color:transparent;
box-shadow:none;
}
.active {
background-color: white;
}
{
box-sizing: border-box;
}
body {
font-family: Arial;
font-size: 17px;
}
.container-fluid {
position: relative;
padding-left: 0px;
}
.container-fluid img {
vertical-align: middle;
}
.container-fluid .content {
position: absolute;
bottom: 0;
background: rgba(0,178,170,0.5); /* Black background with transparency */
color: #f1f1f1;
width: 100%;
padding: 20px;
height: 500px;
}
Please use navbar-light or navbar-dark so the link colors work against the contrast of the background image or color
somewhat like this:
<nav class="navbar navbar-light transparent">
or
<nav class="navbar navbar-dark transparent">
The best way to use background-image with background overlay.
.image {
background-color: #490d40;
background: url(https://sonorangirl.github.io/Earth-Quotes/img/google-earth-view-South-Iceland3.jpg)
no-repeat center center;
background-size: cover;
height: 200px;
position: relative;
}
.image:before {
content: "";
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 1;
background-color: rgba(51, 23, 14, 0.6);
}
.navbar {
height: 80px;
background-color: transparent;
border: none;
color: white;
z-index: 100;
transition: background-color 1s ease 0s;
}
.navbar-default .navbar-brand {
margin-top: 10px;
color: white;
}
.navbar-default .navbar-nav > li > a {
color: white;
padding: 10px 20px;
margin: 10px 5px 5px 5px;
}
.navbar-default .navbar-nav > li > a:hover {
background-color: #000;
color: #fff;
}
<body>
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#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" href="#">Logo</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<li>About</li>
<li>Link</li>
<li>Another Link</li>
</ul>
</div>
<!--/.nav-collapse -->
</div>
</nav>
<div class="image"></div>
</body>
demo
I've added a class header to the section element which contains the nav-bar and added this style:
.header { position: relative; z-index: 2; }
The header will position itself on top of the background.
Example: https://jsfiddle.net/y817zo62/
I recently started to play round with Bootstrap and I created my logo to go on the top left of the page, and then the nav bar to go on the same line but on the right hand side, and then I wanted to say in the middle of the screen: "Welcome blablah"
However, the welcome bit appears on the top part of the screen, rather then the middle, so it's overlapping the logo for some reason.
Not sure why this is doing this, guessing some bad coding etc.
body {
font-family: 'Open Sans', sans-serif, Arial;
font-size: 16px;
color: #6D6D6D;
background-color: #F5F5F5;
font-weight: 300;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: 'Montserrat', sans-serif, Arial;
padding-bottom: 5px;
color: #373432;
line-height: 1em;
font-weight: normal;
}
a {
text-decoration: none;
outline: none;
}
.parallax {
background-image: url("../Images/back1.jpg");
min-height: 1000px;
background-attachment: fixed;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
width: 100%;
}
.logo {
float: left;
padding-top: 50px;
padding-left: 40px;
}
.logo h1 {
text-transform: uppercase;
font-weight: 900;
font-size: 60px;
letter-spacing: -5px;
line-height: 50px;
color: white;
}
.navbar-nav>li>a {
line-height: 6px;
}
.navbar {
float: right;
padding-top: 53px;
padding-right: 60px;
font-size: 13px;
text-transform: uppercase;
}
.navbar-default {
background-color: transparent;
border-top: 0px solid rgba(0, 0, 0, 0.5);
border-bottom: 0px solid rgba(0, 0, 0, 0.5);
border-left: 0px solid rgba(0, 0, 0, 0.5);
border-right: 0px solid rgba(0, 0, 0, 0.5);
}
.navbar-default .navbar-nav>li>a {
color: #ffffff;
}
.navbar-default .navbar-nav>li>a:hover,
.navbar-default .navbar-nav>li>a:focus {
background-color: #F8BD23;
text-decoration: none;
color: #ffffff;
-webkit-transition: background-color 200ms linear;
-moz-transition: background-color 200ms linear;
-o-transition: background-color 200ms linear;
-ms-transition: background-color 200ms linear;
transition: background-color 200ms linear;
}
.navbar-nav>li {
padding-left: 30px;
}
<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" />
<div class="parallax">
<div class="logo"><img src="http://placehold.it/50x50"></div>
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button aria-controls="navbar" aria-expanded="false" class="navbar-toggle collapsed" data-target="#navbar" data-toggle="collapse" type="button"><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">
<li>
Home
</li>
<li>
a
</li>
<li>
b
</li>
<li>
c Us
</li>
<li>
d
</li>
<li>
e
</li>
<li>
f
</li>
<li class="dropdown">
<a aria-expanded="false" aria-haspopup="true" class="dropdown-toggle" data-toggle="dropdown" href="#" role="button">Classes</a>
<ul class="dropdown-menu">
<li>
a
</li>
<li>
b
</li>
<li>
c
</li>
<li>
d
</li>
<li>
We
</li>
<li>
r
</li>
<li>
a
</li>
</ul>
</li>
</ul>
</div>
<!--/.nav-collapse -->
</div>
<!--/.container-fluid -->
</nav>
<div class="container">
<div class="HomeMes">
<h1>WELCOME</h1>
</div>
</div>
</div>
The way I could "fix" it is do margin-top: 200px; on the HomeMes class but I know this is bad coding, so I'm trying to find the right way of doing it. If anyone could let me know what I have done wrong that would be excellent. Thanks.
So it should look like this :
Logo Navbar
Welcome message
There you go sir, change your container class to this :
.container {
width:100%;
height:100%;
display:flex;
justify-content:center;
flex-direction: column;
align-items: center;
}
Tested it in chrome and it works, but for some reason it doesn't work in code snippet preview. Hope this helps you. Display:flex helps a lot when trying to horizontally+vertically align elements!
My code is a bit messy as i am learning bootstrap.
How do i go about resolving the empty space between the top and side bar
<!DOCTYPE html>
<html lang="en">
<style type="text/css">
.navbar-brand>img {
max-height: 100%;
height: 100%;
width: auto;
margin: 0 auto;
/* probably not needed anymore, but doesn't hurt */
-o-object-fit: contain;
object-fit: contain;
}
</style>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Simple Sidebar - Start Bootstrap Template</title>
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="css/simple-sidebar.css" rel="stylesheet">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<nav class="navbar navbar-default">
<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" href="http://disputebills.com"><img src="http://disputebills.com/site/uploads/2015/10/dispute.png" alt="Dispute Bills"></a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="active">Home</li>
<li>About</li>
<li>Contact</li>
</ul>
</div>
</div>
</nav>
</div>
<div id="wrapper">
<!-- Sidebar -->
<div id="sidebar-wrapper">
<ul class="sidebar-nav">
<li class="sidebar-brand">
<a href="#">
TER
</a>
</li>
<li>
</li>
<li>
</li>
<li>
</li>
<li>
</li>
<li>
</li>
<li>
</li>
<li>
</li>
</ul>
</div>
<!-- /#sidebar-wrapper -->
<!-- Page Content -->
<div id="page-content-wrapper">
<div class="container-fluid">
<div class = "row">
<div class = "panel panel-default">
<div class = "panel-header">
<h1> TER</H1>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-3 col-md-3">
<div class = "panel panel-default">
<div class = "panel-body">
<img src="images.jpg" class="img-circle " alt="Cinque Terre" width="200" height="200">
</div>
Toggle Menu
</div>
</div>
<div class="col-lg-6 col-md-6">
</div>
<div class="col-lg-3 col-md-3">
<h1>TER</h1>
<div class = "panel panel-default">
</div>
</div>
</div>
</div>
</div>
<div id ="charts-wrapper">
<div class = "container-fluid">
<div class = "row">
<div col = "col-lg-3">
haha
</div>
</div>
</div>
</div>
<!-- /#page-content-wrapper -->
<!-- /#wrapper -->
<!-- jQuery -->
<script src="js/jquery.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.min.js"></script>
<!-- Menu Toggle Script -->
<script>
$("#menu-toggle").click(function(e) {
e.preventDefault();
$("#wrapper").toggleClass("toggled");
});
</script>
</body>
Attached is a snippet of the page.
I would like the side and top bar to be joined together as bar of the template frame of my webpage.
/*!
* Start Bootstrap - Simple Sidebar HTML Template (http://startbootstrap.com)
* Code licensed under the Apache License v2.0.
* For details, see http://www.apache.org/licenses/LICENSE-2.0.
*/
/* Toggle Styles */
#wrapper {
padding-left: 0;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#wrapper.toggled {
padding-left: 250px;
}
#sidebar-wrapper {
z-index: 1000;
position: fixed;
left: 250px;
width: 0px;
height: 100%;
margin-left: -250px;
overflow-y: auto;
background: #000;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#wrapper.toggled #sidebar-wrapper {
width: 250px;
}
#page-content-wrapper {
width: 100%;
position: absolute;
padding: 15px;
}
#wrapper.toggled #page-content-wrapper {
position: absolute;
margin-right: -250px;
}
/* Sidebar Styles */
.sidebar-nav {
position: absolute;
top: 0;
width: 250px;
margin: 0;
padding: 0;
left: 0;
list-style: none;
}
.sidebar-nav li {
text-indent: 20px;
line-height: 40px;
}
.sidebar-nav li a {
display: block;
text-decoration: none;
color: #999999;
}
.sidebar-nav li a:hover {
text-decoration: none;
color: #fff;
background: rgba(255,255,255,0.2);
}
.sidebar-nav li a:active,
.sidebar-nav li a:focus {
text-decoration: none;
}
.sidebar-nav > .sidebar-brand {
height: 65px;
font-size: 18px;
line-height: 60px;
}
.sidebar-nav > .sidebar-brand a {
color: #999999;
}
.sidebar-nav > .sidebar-brand a:hover {
color: #fff;
background: none;
}
#media(min-width:768px) {
#wrapper {
padding-left: 250px;
}
#wrapper.toggled {
padding-left: 0;
}
#sidebar-wrapper {
width: 250px;
}
#wrapper.toggled #sidebar-wrapper {
width: 0;
}
#page-content-wrapper {
padding: 20px;
position: relative;
}
#wrapper.toggled #page-content-wrapper {
position: relative;
margin-right: 0;
}
}
Have you added any extra CSS to this design, or only working off of the Bootstrap default CSS file?
If the latter, just go into that file and find the classes that reference the navbar and the sidebar, then take note of the position and margin elements.
The navbar is likely going to have a 'fixed' position, which is obvious being that it is stuck to the top of the page no matter the scroll position.
You probably want the sidebar to scroll with the rest of the page though, so you'll want to set the margins for the top of the sidebar div to 0. Then you want to set the position of the sidebar-wrapper div to 'absolute' if it's not already, then add the following:
left:0;
that should do it, but if not (depending on the div hierarchy), try adding the following as well:
top:[px height of navbar];
All you should need to do is remove the margin from the bottom of the .navbar which is 20px by default.
.navbar.navbar-default {
margin-bottom: 0;
}
See working Snippet.
$("#menu-toggle").click(function(e) {
e.preventDefault();
$("#wrapper").toggleClass("toggled");
});
.navbar.navbar-default {
margin-bottom: 0;
}
.navbar-brand>img {
max-height: 100%;
height: 100%;
width: auto;
margin: 0 auto;
/* probably not needed anymore, but doesn't hurt */
-o-object-fit: contain;
object-fit: contain;
}
#wrapper {
padding-left: 0;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#wrapper.toggled {
padding-left: 250px;
}
#sidebar-wrapper {
z-index: 1000;
position: fixed;
left: 250px;
width: 0px;
height: 100%;
margin-left: -250px;
overflow-y: auto;
background: #000;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#wrapper.toggled #sidebar-wrapper {
width: 250px;
}
#page-content-wrapper {
width: 100%;
position: absolute;
padding: 15px;
}
#wrapper.toggled #page-content-wrapper {
position: absolute;
margin-right: -250px;
}
/* Sidebar Styles */
.sidebar-nav {
position: absolute;
top: 0;
width: 250px;
margin: 0;
padding: 0;
left: 0;
list-style: none;
}
.sidebar-nav li {
text-indent: 20px;
line-height: 40px;
}
.sidebar-nav li a {
display: block;
text-decoration: none;
color: #999999;
}
.sidebar-nav li a:hover {
text-decoration: none;
color: #fff;
background: rgba(255, 255, 255, 0.2);
}
.sidebar-nav li a:active,
.sidebar-nav li a:focus {
text-decoration: none;
}
.sidebar-nav > .sidebar-brand {
height: 65px;
font-size: 18px;
line-height: 60px;
}
.sidebar-nav > .sidebar-brand a {
color: #999999;
}
.sidebar-nav > .sidebar-brand a:hover {
color: #fff;
background: none;
}
#media(min-width:768px) {
#wrapper {
padding-left: 250px;
}
#wrapper.toggled {
padding-left: 0;
}
#sidebar-wrapper {
width: 250px;
}
#wrapper.toggled #sidebar-wrapper {
width: 0;
}
#page-content-wrapper {
padding: 20px;
position: relative;
}
#wrapper.toggled #page-content-wrapper {
position: relative;
margin-right: 0;
}
}
<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.6/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<nav class="navbar navbar-default">
<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" href="http://disputebills.com">
<img src="http://disputebills.com/site/uploads/2015/10/dispute.png" alt="Dispute Bills">
</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="active">Home
</li>
<li>About
</li>
<li>Contact
</li>
</ul>
</div>
</div>
</nav>
</div>
<div id="wrapper">
<!-- Sidebar -->
<div id="sidebar-wrapper">
<ul class="sidebar-nav">
<li class="sidebar-brand">
<a href="#">
TER
</a>
</li>
<li>
</li>
<li>
</li>
<li>
</li>
<li>
</li>
<li>
</li>
<li>
</li>
<li>
</li>
</ul>
</div>
<!-- /#sidebar-wrapper -->
<!-- Page Content -->
<div id="page-content-wrapper">
<div class="container-fluid">
<div class="row">
<div class="panel panel-default">
<div class="panel-header">
<h1> TER</H1>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-3 col-md-3">
<div class="panel panel-default">
<div class="panel-body">
<img src="images.jpg" class="img-circle " alt="Cinque Terre" width="200" height="200">
</div>
Toggle Menu
</div>
</div>
<div class="col-lg-6 col-md-6">
</div>
<div class="col-lg-3 col-md-3">
<h1>TER</h1>
<div class="panel panel-default">
</div>
</div>
</div>
</div>
</div>
<div id="charts-wrapper">
<div class="container-fluid">
<div class="row">
<div col="col-lg-3">
haha
</div>
</div>
</div>
</div>
I have two problems with my navigation in twitter bootstrap.
the links jump out of the navigation when I re-size the browser window
and 2. the collapsed navigation is hidden behind the carousel.
I want all my links in the navigation to have the same width, because they get a border in mouse-over but because of that they jump out of the navigation and are hidden behind the carousel/slider when re-sized.
They collapse just fine when re-sized to 768px but everything above that jumps out of navigation. And the other thing is that when the navigation is collapsed it is half hidden behind the carousel/slider when opened.
<nav class="navbar navbar-inverse" role="navigation">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div class="navbar-header">
<a class="navbar-brand" href="index.html">Test</a>
</div>
<div class="nav-collapse collapse navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<li class="span4">Home</li>
<li class="span4">Forschung</li>
<li class="span4">Fahrzeug</li>
<li class="span4">Team</li>
<li class="span4">Presse</li>
<li class="span4">Ziele</li>
<li class="span4">Karte</li>
<li class="span4">Jobs</li>
</ul>
</div>
</nav>
<div class="container">
<div id="this-carousel-id" class="carousel slide">
<ol class="carousel-indicators">
<li data-target="#this-carousel-id" data-slide-to="0" class="active"></li>
</ol>
<div class="carousel-inner">
<div class="item active">
<img src="http://placehold.it/1200x480" alt="" />
<div class="carousel-caption"><h1>Mercedes Benz</h1></div>
</div>
</div>
<a class="carousel-control left" href="#this-carousel-id" data-slide="prev"><span class="glyphicon glyphicon-chevron-left"></span></a>
<a class="carousel-control right" href="#this-carousel-id" data-slide="next"><span class="glyphicon glyphicon-chevron-right"></span></a>
</div>
</div>
and this is the css
.navbar {
height: 100px;
font-family: 'Oswald', sans-serif;
text-transform: uppercase;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
padding-right: 5%;
background-color: #000000 !important;
box-sizing: border-box;
}
.navbar-inverse .navbar-nav > li > a { color: #a2a2a2 !important }
.nav a:link,
a:visited {
line-height: 4em;
display: block;
height: 100px;
width: 120px;
text-align: center;
text-decoration: none;
}
.nav a:after {
position: absolute;
top: 100%;
left: 0;
width: 100%;
height: 1px;
background: #062d67;
content: '';
opacity: 0;
-webkit-transition: height 0.3s, opacity 0.3s, -webkit-transform 0.3s;
-moz-transition: height 0.3s, opacity 0.3s, -moz-transform 0.3s;
transition: height 0.3s, opacity 0.3s, transform 0.3s;
-webkit-transform: translateY(-10px);
-moz-transform: translateY(-10px);
transform: translateY(-10px);
}
.nav a:hover,
a:focus,
a:active {
height: 81px;
color: #ffffff !important;
background-color: #0d0d0d !important;
}
.nav a:hover:after,
.nav a:focus:after,
.nav a:active:after {
height: 18px;
opacity: 1;
-webkit-transform: translateY(0px);
-moz-transform: translateY(0px);
transform: translateY(0px);
}
Can anyone please point out what I did wrong?
You can't have 8 span4 elements in one row. the total sum of N in spanN must be 12 or below.
you can use span1in your case or no class on for <li> (list item) elements at all.