Bootstrap navbar menu not displayed on mobile - html

I am using bootstrap 4 to make a simple theme.
My problem is, that when I view the page on mobile, and click the menu button, the menu shows up for 1 second, and then hide it self. If I click the button gain, it wont show up.
Demo site here
My menu source code from the browser (I don't use the sticky classes)
<header class="header header-sticky- header-transparent__">
<div class="container">
<div class="row">
<div class="col-12">
<nav class="navbar navbar-expand-lg">
<!-- Logo START -->
<a class="navbar-brand" title="IQ Logistics Kft." href="https://kozetgyapot-arak.hu">
<img class="img-fluid" src="https://themes.potenzaglobalsolutions.com/html/bulky/images/logo.svg" alt="IQ Logistics Kft.">
</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="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav m-auto_">
<li class="nav-item"><a class="nav-link" title="Kezdőlap" href="https://kozetgyapot-arak.hu/">Kezdőlap</a></li><li class="nav-item"><a class="nav-link" title="Rólunk" href="https://kozetgyapot-arak.hu/rolunk">Rólunk</a></li><li class="nav-item"><a class="nav-link" title="Szolgáltatások" href="https://kozetgyapot-arak.hu/szolgaltatasok">Szolgáltatások</a></li><li class="nav-item"><a class="nav-link" title="Elérhetőségeink" href="https://kozetgyapot-arak.hu/elerhetosegeink">Elérhetőségeink</a></li> </ul>
</div>
<div class="mr-5 mr-lg-0 d-sm-flex d-none align-items-center">
<a class="btn btn-primary" href="https://kozetgyapot-arak.hu/arajanlat-kerese">Árajánlat kérése <i class="fa fa-chevron-right ml-1"></i></a>
</div>
</nav>
</div>
</div>
</div>
</header>
Thank you, if someone can help me.

It seems to work fine with this html. Note that I did leave out the Font Awesome stylesheet in the snippet below. Also note that the popper script is bundled in the bootstrap script so you heave to remove it from your project as an extra script.
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap#4.5.3/dist/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#4.5.3/dist/js/bootstrap.bundle.min.js"></script>
<header class="header header-sticky- header-transparent__">
<div class="container">
<div class="row">
<div class="col-12">
<nav class="navbar navbar-expand-lg navbar-light">
<a class="navbar-brand" title="IQ Logistics Kft." href="https://kozetgyapot-arak.hu">
<img class="img-fluid" src="https://themes.potenzaglobalsolutions.com/html/bulky/images/logo.svg" alt="IQ Logistics Kft.">
</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="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav m-auto">
<li class="nav-item"><a class="nav-link" title="Kezdőlap" href="https://kozetgyapot-arak.hu/">Kezdőlap</a></li>
<li class="nav-item"><a class="nav-link" title="Rólunk" href="https://kozetgyapot-arak.hu/rolunk">Rólunk</a></li>
<li class="nav-item"><a class="nav-link" title="Szolgáltatások" href="https://kozetgyapot-arak.hu/szolgaltatasok">Szolgáltatások</a></li>
<li class="nav-item"><a class="nav-link" title="Elérhetőségeink" href="https://kozetgyapot-arak.hu/elerhetosegeink">Elérhetőségeink</a></li>
</ul>
</div>
<div class="mr-5 mr-lg-0 d-sm-flex d-none align-items-center">
<a class="btn btn-primary" href="https://kozetgyapot-arak.hu/arajanlat-kerese">Árajánlat kérése <i class="fa fa-chevron-right ml-1"></i></a>
</div>
</nav>
</div>
</div>
</div>
</header>

Related

how to align navbar items to the right(not the brand)

its been so nice with stack overflow.I am currently in a bootcamp of Angela Yu.using bootstrap is fun but in the navbar section i am facing some issues.I cant move my nav item to the right.in the ul ,I am using a class ml-auto but its not running.For your better experience I m putting full code-
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container">
<a class="navbar-brand" href="">tinDog</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarTogglerDemo01" aria-controls="navbarTogglerDemo01" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarTogglerDemo01" >
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="#"> contact</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#"> Pricing</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#"> download</a>
</li>
</ul>
</div>
</div>
i have put all other elements nicely!
can you guys give me a way or modify this code for my purpose?
The code above aligned it to the right for me when I tried it but I had to close out <nav>. In your code, you forgot to close it out with </nav>. Also, make sure you linked the bootstrap CDN properly by adding <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"> in the head of your html.I fixed the toggle button which wasn't working in smaller screens. Here is my code with the bootstrap style sheet included. Copy it and run it to see if it works for you.
<nav class="navbar navbar-expand-sm fixed-top navbar-dark bg-dark">
<div class="container">
<a class="navbar-brand text-white" href="#" >tinDog</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo02" aria-controls="navbarTogglerDemo02" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarTogglerDemo02">
<ul class="navbar-nav ml-auto ">
<li class="nav-item">
<a class="nav-link text-light" href="#">Contact</a>
</li>
<li class="nav-item">
<a class="nav-link text-light" href="#">Pricing</a>
</li>
<li class="nav-item">
<a class="nav-link text-light" href="#">Download</a>
</li>
</ul>
</div>
</div>
</nav>

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>

Bootstrap NavBar Alignment (3 Columns with Responsive Menu)

I basically have a pretty simple question, but my portfolio will look better if I can make this simple addition.
I want my NavBar in bootstrap to be in 3 columns, essentially like the image I've mocked up below.
I currently have the base bootstrap navBar setup with the default code like so:
<!-- Navigation -->
<nav class="navbar navbar-expand-lg bg-white fixed-top">
<div class="container">
<a class="nav-link" href="#">my name goes here</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<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="#">about</a></li>
<li class="nav-item"><a class="nav-link" href="#">resume</a></li>
</ul>
</div>
</div>
</nav>
I can make a weird version look right with messing with padding and stuff, but I dont want that. The hardest part for me is understanding the responsive version, and having the one link on the left (work) and two links on the right (about, resume) merge into one dropdown navigation and have the 'my name goes here' become the header above it on mobile.
Any help, or a point in the right direction would be great.
Also, it can be assumed my CSS is the base bootstrap CSS.
Thanks
UPDATE
<!-- Navigation -->
<nav class="navbar navbar-light navbar-expand-md bg-success justify-content-between">
<div class="container-fluid">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".dual-nav">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse dual-nav w-50 order-1 order-md-0">
<ul class="navbar-nav">
<li class="nav-item active">
<a class="nav-link pl-0" href="#">work <span class="sr-only">work</span></a>
</li>
</ul>
</div>
Colin Grant
<div class="navbar-collapse collapse dual-nav w-50 order-2">
<ul class="nav navbar-nav ml-auto">
<li class="nav-item"><a class="nav-link" href="">about</a></li>
<li class="nav-item"><a class="nav-link" href="">resume</a></li>
</ul>
</div>
</div>
This seems to work perfectly, any tips for makign it better?
Thanks
Following is how I did it using bootstrap 4. When screen size is <992px right side of the navbar will collapse into a button.
<nav class="navbar navbar-expand-lg navbar-dark bg_color_primary sticky-top d-flex justify-content-between ">
<div class="navbar-nav col-4 align-items-start ">
<div class="text-white bg_color_primary_light rounded-circle p-2">
Work
</div>
</div>
<div class="col-4 d-flex justify-content-center">
<a class="navbar-brand text-white brand_name " href="">
BrandName
</a>
</div>
<button class=" navbar-toggler ml-auto align-items-end" type="button" data-toggle="collapse"
data-target="#navbarNavDropdown"
aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse col-4 " id="navbarNavDropdown">
<div class="navbar-nav ml-auto ">
<a class="nav-item nav-link" href="">About</a>
<a class="nav-item nav-link" href="">Resume</a>
</div>
</div>
</nav>

Bootstrap unexpected result?

Basically my col's don't work or i am not doing something right?
Here's an image i attached bellow
P.S.: I am a newbie with bootstrap just got started with it so please don't get mad at small mistakes.
I am using Bootstrap version 4
Img here with the problem
Here's my code
<body>
<header>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<a class="navbar-brand" href="#"><img src="images/amf-logo.jpg"
alt="amfLogo"
width="130px" height="40px"></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="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<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="#">Galerie</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Contact</a>
</li>
</nav>
<div class="container">
<div class="row">
<div class="col-md-3 col-sm-4"> <!-- you must close this -->
<p>
acxzcxzcxzcxzvcxzvcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxz
</p>
</div>
<div class="col-md-3 col-sm-4"
<p> azcxxxxxxxxxxxxxxxxxxxxsdazcxxxxx </p>
</div>
</div>
</div>
<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.3/umd/popper.min.js"
integrity="sha384-
vFJXuSJphROIrBnz7yo7oB41mKfc8JzQZiCq4NCceLEaO4IHwicKwpJf9c9IpFgh"
crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-
beta.2/js/bootstrap.min.js" integrity="sha384-
alpBpkh1PFOepccYVYDB4do5UnbKysX5WZXm3XxPqe5iKTfUKjNkCk9SaVuEZflJ"
crossorigin="anonymous"></script>
I put the code into codepen and the page displays properly there. See for yourself:
https://codepen.io/dakata911/pen/mqagWO
I think this works fine. :)
Try this out...
If this doesn't work tell me what size screen you are viewing this on.
<body>
<header>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<a class="navbar-brand" href="#"><img src="images/amf-logo.jpg"
alt="amfLogo"
width="130px" height="40px"></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="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<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="#">Galerie</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Contact</a>
</li>
</nav>
<div class="container-fluid">
<div class="row">
<div class="col-md-3 col-sm-4"> <!-- you must close this -->
<p>
acxzcxzcxzcxzvcxzvcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxz
</p>