Resizing Bootatrap4 Navigation bar not working acordingly - html

.navbar.navbar-expand-lg.navbar-light.bg-light{
width:1920px;
background-color:#eee;
height:50px;
}
footer{
background-color:grey;
}
#media screen and (min-width:320px){
.navbar.navbar-expand-lg.navbar-light.bg-light{
width:100%;
}
}
#media screen and (min-width:985px){
#tog{
height:50px;
}
}
<div class="container-fluid">
<div class="row">
<nav class="navbar navbar-expand-lg navbar-light bg-light" id="tog" role="navigation">
<div class="navbar-header">
<a id="x" class="navbar-brand" href="http://disputebills.com">
<img style="padding-bottom:75px; " id="image;" src="assets/logo.png" alt=" x">MANAGEMENT SYSTEM
</a>
</div>
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#collapsibleNavbar" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon" id="but"></span>
</button>
<div class="collapse navbar-collapse justify-content-between" id="collapsibleNavbar">
<div class="col-2"></div>
<ul class="navbar-nav ml-auto">
<li class="nav-item active">
<a class="nav-link" routerLink="/table">Details
</a>
</li>
<li class="nav-item active">
<a class="nav-link" routerLink="/assigned-employees">Employees</a>
</li>
<li class="nav-item active ">
<a class="nav-link" routerLink="/bug-reporting">Report</a>
</li>
</ul>
</div>
</nav>
</div>
</div>
<div class="container-fluid">
<div class="row">
<footer id="footer" role="contentinfo">
<div class="container-fluid">
<div class="row footer-list-row">
<div class="col-sm-6">
<div class="row">
<div class="col-xs-6" id="com">
<h3>Company</h3>
<ul>
<li>
<a href=''>About</a>
</li>
<li>
<a href=''>News</a>
</li>
<li>
<a href=''>Careers</a>
</li>
</ul>
</div>
<div class="col-xs-6" id="sol">
<h3>Solutions</h3>
<ul>
<li>
<a href=''>Applications</a>
</li>
<li>
<a href=''>Planning</a>
</li>
<li>
<a href=''>Service</a>
</li>
<li>
<a href=''>Management</a>
</li>
</ul>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="row">
<div class="col-xs-6" id="part">
<h3>Part</h3>
<ul>
<li>
<a href=''>Partner</a>
</li>
<li>
<a href=''>Partner</a>
</li>
<li>
<a href=''>Login</a>
</li>
</ul>
</div>
<div class="col-xs-6" id="contact">
<h3>Contact Us</h3>
<ul>
<li>
<a href=''>Contact Us</a>
</li>
<li>
<a href=''>Addresses</a>
</li>
<li>
<a href=''>Feedback</a>
</li>
<li>
<a href=''>Login</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</footer>
</div>
</div>
I have implemented bootstrap 4 navigation bar inside my web application.Since it is little bit of tall than I expected I needed to customize its height in to 50px. Soon after I did the customization, mobile view stated to show a malicious behavior. when I try to expand the menu by clicking the "List Icon" it expands the list underneath of other DIV s like follow (Like when it has z index -1)
List View
This is the html code I used for navigation bar
<nav class="navbar navbar-expand-lg navbar-light bg-light" id="tog" role="navigation" style="width:1920px; height:50px;">
<div class="navbar-header">
<a id="x" class="navbar-brand" href="http://disputebills.com">
<img style="padding-bottom:75px; " id="image;" src="assets/logo.png" alt="Dispute Bills">ATTENDENCE MANAGEMENT SYSTEM
</a>
</div>
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#collapsibleNavbar" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon" id="but"></span>
</button>
<div class="collapse navbar-collapse justify-content-between" id="collapsibleNavbar">
<div class="col-2"></div>
<ul class="navbar-nav ml-auto">
<li class="nav-item active">
<a class="nav-link" routerLink="/table">My Details
</a>
</li>
<li class="nav-item active">
<a class="nav-link" routerLink="/assigned-employees">Assigned Employees List</a>
</li>
<li class="nav-item active ">
<a class="nav-link" routerLink="/bug-reporting">Report Bugs</a>
</li>
</ul>
</div>
</nav>
I have tried by changing the z-index. But it didn't work for me. any clue on this please

Related

How do I align the container at the top with my navigation bar in Bootstrap 5?

new to bootstrap! I am trying to align the navigation bar and the top title. The yellow area is wider than the navigation bar. I also need help setting the background image to span the whole website. If anyone can give me some suggestions, it would be appreciated!
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.0.2/dist/js/bootstrap.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" />
<!doctype html>
<div class="container bg-warning">
<div class="row">
<div class="d-flex justify-content-center">
<p class="display-1">Thuan's Website</p>
</div>
</div>
</div>
<div class="container">
<nav class="navbar navbar-expand-sm navbar-dark bg-dark">
<a href="#" class="navbar-brand" />
<img src="https://img.icons8.com/ios-glyphs/30/000000/redo.png" />Thuan
</a>
<div class="collapse navbar-collapse">
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a href="#" class="nav-link">Home
</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">Forums
</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">Games
</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">Contact
</a>
</li>
</ul>
</div>
</nav>
</div>
In order to get the title and navbar full width just put it oustside container class
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.0.2/dist/js/bootstrap.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" />
<div class="d-flex justify-content-center bg-warning">
<p class="display-1">Thuan's Website</p>
</div>
<nav class="navbar navbar-expand-sm navbar-dark bg-dark">
<a href="#" class="navbar-brand" />
<img src="https://img.icons8.com/ios-glyphs/30/000000/redo.png" />Thuan
</a>
<div class="collapse navbar-collapse">
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a href="#" class="nav-link">Home
</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">Forums
</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">Games
</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">Contact
</a>
</li>
</ul>
</div>
</nav>
<div class="container">
<div class="row">
</div>
</div>

Why does my col-x doesn't work as expected in bootstrap?

I am trying to add a Login button to my navbar in bootstrap, but when I add col-x to separate them equally, but they just cover 50% of the width of the navbar and nothing more. But when I use col-x outside then navbar it works perfectly.
The code
<!-- Navigation -->
<nav class="navbar navbar-dark navbar-expand-md bg-blue sticky-top">
<div class="container-fluid">
<div class="row">
<div class="col-4">
<a class="navbar-brand" href="#">
<h1 class="display-3">Petitions</h1>
</a>
</div>
<div class="col-4">
<button type="button" class="btn btn-primary btn-lg">
Get Started
</button>
</div>
<div class="col-4">
<button
class="navbar-toggler"
type="button"
data-toggle="collapse"
data-target="#navbarResponsive"
>
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="#">Начало</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Цел на компанията</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">За компанията</a>
</li>
</ul>
</div></div>
</div>
</div>
</nav>
<!-- Navigation -->
I Think you want to make something like this:
<nav class="navbar navbar-dark navbar-expand-md sticky-top" style="background-color: #000000;">
<div class="container-fluid">
<div class="row" style="width: 100%; margin-left: 0px; margin-right: 0px;">
<div class="col-4">
<a class="navbar-brand" href="#">
<h1 class="display-3">Petitions</h1>
</a>
</div>
<div class="col-4">
<button type="button" class="btn btn-primary btn-lg">
Get Started
</button>
</div>
<div class="col-4">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="#">Начало</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Цел на компанията</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">За компанията</a>
</li>
</ul>
</div></div>
</div>
</div>
</nav>

Bootstrap hamburger menu not collapsing

I'm building a site in Bootstrap and my hamburger menu is not collapsing. Here is the HTML code:
<section>
<div class="container-fluid main-banner">
<div class="row">
<div class="col-12">
<nav class="navbar navbar-expand-lg navbar-light bg-light main-nav">
<a class="navbar-brand" href="#"><img src="images/logo.png"></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="custom-toggler" role="button" ><i class="fa fa-bars" aria-hidden="true"></i></span>
</button>
<div class="collapse navbar-collapse">
<ul class="navbar-nav ml-auto">
<li class="nav-item"> <a class="nav-link" href="#">Home</a> </li>
<li class="nav-item"> <a class="nav-link" href="#">Our Culture</a> </li>
<li class="nav-item"> <a class="nav-link" href="#">Our Curriculum</a> </li>
<li class="nav-item"> <a class="nav-link" href="#">News</a> </li>
<li class="nav-item"> <a class="nav-link see-through-button" href="#">Apply</a> </li>
</ul>
</div>
</nav>
</div>
</div>
<div class="row main-banner-text">
<div class="col-lg-6">
<h1>Know Your Greatness.</h1>
<h3>Develop your passion and align your education with real world needs.</h3>
<div class="top-padding">Your future starts now</div>
</div>
<div class="col-lg-6"></div>
</div>
</div>
</section>
I would appreicate any feedback as I am pretty much stumped at this point. I've tried looking on other threads but haven't found anything yet.
You need to call id used in data-target="#navbarSupportedContent" for show hide navbar div please check below code
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script><section>
<div class="container-fluid main-banner">
<div class="row">
<div class="col-12">
<nav class="navbar navbar-expand-lg navbar-light bg-light main-nav">
<a class="navbar-brand" href="#"><img src="images/logo.png"></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="custom-toggler" role="button" ><i class="fa fa-bars" aria-hidden="true"></i></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto">
<li class="nav-item"> <a class="nav-link" href="#">Home</a> </li>
<li class="nav-item"> <a class="nav-link" href="#">Our Culture</a> </li>
<li class="nav-item"> <a class="nav-link" href="#">Our Curriculum</a> </li>
<li class="nav-item"> <a class="nav-link" href="#">News</a> </li>
<li class="nav-item"> <a class="nav-link see-through-button" href="#">Apply</a> </li>
</ul>
</div>
</nav>
</div>
</div>
<div class="row main-banner-text">
<div class="col-lg-6">
<h1>Know Your Greatness.</h1>
<h3>Develop your passion and align your education with real world needs.</h3>
<div class="top-padding">Your future starts now</div>
</div>
<div class="col-lg-6"></div>
</div>
</div>
</section>

How to make make navbar responsive, using a template

I'm using a colorlib template called faithful: https://colorlib.com/wp/template/faithful/
Basically I changed the css and the navbar to a horizontal one, the problem is when I view it in mobile, it doesn't work
This is what I did to change the navbar to a horizontal one
<div class="site-navbar-wrap js-site-navbar bg-white">
<div class="container">
<div class="site-navbar bg-light">
<div class="py-1">
<div class="row align-items-center">
<div class="col-2">
<a class="d-block" href="index.html" rel="home"><img class="d-block" src="images/company_logo.png" alt="logo"></a>
</div>
<div class="col-10">
<nav class="navbar navbar-default" role="navigation">
<div class="navbar-header">
<ul class="navbar-default" id="menu">
<li class="active">
Home
</li>
<a class="dropdown-toggle fa" data-toggle="dropdown" href="about.html" >About Us<span></span></a>
<ul class="dropdown-menu">
<li>Our Company</li>
<li>Team</li>
<li>Goals</li>
<li>Location</li>
</ul>
<li>Products</li>
</li>
<li>Merchandise</li>
<li>FAQs</li>
<li>Contact Us</li>
</ul>
</div>
</nav>
</div>
</div>
</div>
</div>
</div>
</div>
I want the navbar to work on mobile (showing a button on the right)
I tried everything I could but it still doesn't work and I've already finished the design of the website, I just really need to change the navbar.
<nav class="navbar navbar-expand-lg navbar-dark primary-color">
<!-- Collapse button -->
<button class="navbar-toggler float-xs-right" type="button" data-toggle="collapse" data-target="#basicExampleNav"
aria-controls="basicExampleNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<!-- Collapsible content -->
<div class="collapse navbar-collapse" id="basicExampleNav">
<!-- Links -->
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="#">Home
<span class="sr-only">(current)</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Our company</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">team</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">goals</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">location</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">products</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">merchandise</a>
</li>
</ul>
</div>
</nav>
you can modify and use this

Bootstrap navbar responsivness

I have got a centered logo in my navbar and three menu categories on the side,when i reduce my resolution some categories start to disappear and when i reduce the resolution for navbar collapse things then get really messed up,the whole collapse menu is shown behind the main slider i have got.This is my code.
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation" style="height:90px;">
<div class="container-fluid">
<div class="navbar-header">
<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>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<div class="row">
<div class="col-md-4">
<ul class="nav navbar-nav ">
<li class="active menu-item">
<a class="menu-link" href="#">Home</a>
</li>
<li class="menu-item">
<a class="menu-link" href="#">About us</a>
</li>
<li class="menu-item">
<a class="menu-link" href="#">Events</a>
</li>
</ul>
</div>
<div class="col-md-4">
<img class="img-responsive center-block" src="images/Night-club.png" title="Night-club logo" alt="Night-club logo">
</div>
<div class="col-md-4">
<ul class="nav navbar-nav ">
<li class="menu-item">
<a class="menu-link" href="#">Gallery</a>
</li>
<li class="menu-item">
<a class="menu-link" href="#">Reservation</a>
</li>
<li class="menu-item">
<a class="menu-link" href="#">Contact</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</nav>
<div class="main-slider-simple">
<ul class="img-slider">
<li>
<img class="img-responsive" src="images/main-img.jpg" title="Night club " alt="Night club " />
</li>
<li>
<img class="img-responsive" src="images/main-img2.jpg" title="Night club " alt="Night club " />
</li>
<li>
<img class="img-responsive" src="images/main-img3.jpg" title="Night club " alt="Night club " />
</li>
</ul>
<!-- Glavni slider -->
</div>
And here is css for the menu links i have set up...
.menu-item{
margin-top:50px;
margin-left:30px;
margin-right:20px;
font-size:30px;
}
How can i accomplish normal responsivness?
Here is the jsfiddle that kinda explains my situation.
http://jsfiddle.net/cELuF/
I've changed the css for the div
.col-md-4
http://jsfiddle.net/cELuF/2/
You will be able to see what i've added in the CSS box.