Does anyone have an idea how can I add black navbar below "some text" in navbar shown below? It doesn't matter how this navbar will look like I would like to have it just across the entire width of the screen below the string Some text. Any ideas?
<nav class="navbar navbar-expand-lg fixed-top navbar-transparent" color-on-scroll="500">
<div class="container">
<div class="navbar-translate">
<button class="navbar-toggler navbar-burger" type="button" data-toggle="collapse" data-target="#navbarToggler"
aria-controls="navbarTogglerDemo02" aria-expanded="false" aria-label="Toggle navigation"
(click)="sidebarToggle()">
<span class="navbar-toggler-bar"></span>
<span class="navbar-toggler-bar"></span>
<span class="navbar-toggler-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse" id="navbarToggler">
<div class="outer">
<div class="middle">
<div class="inner">
<br><br><br>
<h6 align="center">Some text</h6>
<div class="black-bar" style="width: 100vw; height: 80px; background-color: white"></div>
</div>
</div>
</div>
<ul class="navbar-nav ml-auto">
<li class="nav-item" *ngIf="!isDocumentation() && !isMain()">
<a class="nav-link" rel="tooltip" title="Follow us on Twitter" data-placement="bottom"
href="https://twitter.com/CreativeTim" target="_blank">
<i class="fa fa-twitter"></i>
<p class="d-lg-none">Twitter</p>
</a>
</li>
<li class="nav-item" *ngIf="!isDocumentation() && !isMain()">
<a class="nav-link" rel="tooltip" title="Like us on Facebook" data-placement="bottom"
href="https://www.facebook.com/CreativeTim" target="_blank">
<i class="fa fa-facebook-square"></i>
<p class="d-lg-none">Facebook</p>
</a>
</li>
<li class="nav-item" *ngIf="!isDocumentation() && !isMain()">
<a class="nav-link" rel="tooltip" title="Follow us on Instagram" data-placement="bottom"
href="https://www.instagram.com/CreativeTimOfficial" target="_blank">
<i class="fa fa-instagram"></i>
<p class="d-lg-none">Instagram</p>
</a>
</li>
<li class="nav-item" *ngIf="!isDocumentation() && !isMain()">
<a class="nav-link" rel="tooltip" title="Star on GitHub" data-placement="bottom"
href="https://www.github.com/CreativeTimOfficial/pk2-angular" target="_blank">
<i class="fa fa-github"></i>
<p class="d-lg-none">GitHub</p>
</a>
</li>
<li class="nav-item" *ngIf="!isDocumentation()">
<a href="http://pk2-angular.creative-tim.com/documentation/tutorial" class="nav-link" target="_blank"><i
class="nc-icon nc-book-bookmark"></i> Documentation</a>
</li>
<li class="nav-item" *ngIf="!isHome()">
<a [routerLink]="['/home']" *ngIf="!isDocumentation()" class="nav-link"><i class="nc-icon nc-layout-11"></i>Components</a>
<a [routerLink]="['/home']" *ngIf="isDocumentation()" class="nav-link">Back to Kit</a>
</li>
<li class="nav-item" *ngIf="isDocumentation()">
<a href="https://github.com/creativetimofficial/pk-free-angular/issues?ref=pk2-free-local" target="_blank"
class="nav-link">Have an issue</a>
</li>
</ul>
</div>
</div>
</nav>
It looks in this way after adding <div class="black-bar" style="width: 100vw; height: 80px; background-color: white"></div> after h6:
You could put a div underneath the < h6 > tag. Something like this..
<div class="black-bar" style="height:100px; background-color: black; position:absolute; left:0; right:0;"></div>
Hope this works for you!
If you're just needing a black line under the "some text", why not do something like:
h6 {
width: 100%;
text-align: center;
border-bottom: solid 80px black;
}
Related
I have a main content part of a sidebar that is supposed to be scrollable if it overflows. The problem is that it makes the whole page scroll instead of just the sidebar. The other problem is that it's supposed to scroll inside of it's container instead of making the whole sidebar scroll.
How do I fix this?
it's supposed to look like this:
___
header
___
nav pill 1
nav pill 2
___
a href image
a href image
...
...
___
button
text
___
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]')
const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl))
window.onload = (event) => {
const tooltip = bootstrap.Tooltip.getInstance('#add_bot_button') // Returns a Bootstrap tooltip instance
tooltip.show();
};
document.getElementById('server_wide_button').addEventListener('click', () => {
document.getElementById('channel_specific_button').classList.remove('active');
document.getElementById('server_wide_button').classList.add('active');
});
document.getElementById('channel_specific_button').addEventListener('click', () => {
document.getElementById('server_wide_button').classList.remove('active');
document.getElementById('channel_specific_button').classList.add('active');
});
document.getElementById('add_bot_button').addEventListener('click', () => {
console.log('adding bot to guild');
});
#sidebar_header {
top: 0;
text-align: center;
position: fixed;
width: inherit;
}
#sidebar_sub_header {
/* top: 0; */
/* position: fixed;
width: inherit; */
}
#sidebar_main_content {
overflow-y: scroll;
}
#sidebar_footer {
position: fixed;
bottom: 0;
width: inherit;
}
#sidebar {
width: 250px;
min-height: 100vh;
max-height: 100vh;
}
/* #sidebar_main_content::-webkit-scrollbar {
width: 0;
height: 0;
} */
#dropdown {
align-items: center;
text-align: center;
}
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.3.0-alpha1/dist/js/bootstrap.bundle.min.js" integrity="sha384-w76AqPfDkMBDXo30jS1Sgez6pr3x5MlQ1ZAGC+nuZB+EYdgRZgiwxhTBTkF7CXvN" crossorigin="anonymous"></script>
<div class="container-fluid">
<div class="row">
<!-- <div class="col align-items-start bg-dark text-white"> -->
<div class="align-items-start text-center p-0 bg-dark text-white" id="sidebar">
<div class="p-3 bg-dark text-white" id="sidebar_header">
<span class="fs-4">
Header
</span>
<hr>
<div class="p-3" id="sidebar_sub_header bg-secondary">
<ul class="nav nav-pills flex-column mb-auto">
<li class="nav-item">
<a href="#" class="nav-link text-white active" aria-current="page" id="server_wide_button">
Test 1
</a>
</li>
<li>
<a href="#" class="nav-link text-white" id="channel_specific_button">
Test 2
</a>
</li>
</ul>
</div>
</div>
<!-- <div class="p-3" id="sidebar_sub_header bg-secondary">
<ul class="nav nav-pills flex-column mb-auto">
<li class="nav-item">
<a href="#" class="nav-link text-white active" aria-current="page" id="server_wide_button">
Test 1
</a>
</li>
<li>
<a href="#" class="nav-link text-white" id="channel_specific_button">
Test 2
</a>
</li>
</ul>
</div> -->
<div class="mb-auto p-3 bg-danger flex-fill" id="sidebar_main_content">
<!-- main content - scrollable -->
<ul class="nav flex-column mb-auto align-items-center">
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
</ul>
</div>
<div class="p-3 bg-dark text-white" id="sidebar_footer">
<a href="#" class="btn btn-primary" id="add_bot_button" role="button" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="Test tooltip">
Test Button
</a>
<br><br>
<div class="dropup-center dropup">
<a href="#" class="align-items-center text-white text-decoration-none dropdown-toggle" id="dropdownUser1" data-bs-toggle="dropdown" aria-expanded="false">
{{ wallet_address }}
</a>
<ul class="dropdown-menu dropdown-menu-dark text-small shadow" aria-labelledby="dropdownUser1">
<li><a class="dropdown-item" href="#">Delete User Info</a></li>
<li><a class="dropdown-item" href="#">Logout</a></li>
</ul>
</div>
</div>
</div>
<div class="col bg-secondary text-white" id="main_content">
One of three columns
</div>
</div>
</div>
Using bootstrap 5.3.0 alpha1
Also - is what I have right so far? Each element is supposed to be fixed in the sidebar. not sure if i need position: fixed for each element or just for the sidebar. any help would be appreciated
edit:
also where test text here 0000000000000000000000000 is, how do i shrink that or confine it inside the div?
edit2: edited code to show some updates
Set different overflow behaviours for the 3 containers
You want the outer container not to scroll. That is important, because if you don't specifically block scrolling of the outer container, it will scroll. That was the cause of your problem.
Then you want the sidebar itself to scroll, and the main content to (separately) scroll.
I have added to your code 3 style attributes, one for each of the 3 containers. I see you are carefully using classes, which is excellent: just put those styles into the relevant classes (I couldn't find the class for the main body text).
#sidebar_header {
top: 0;
text-align: center;
}
#sidebar_sub_header {
/* position: fixed; */
/* width: inherit; */
}
#sidebar_main_content {
overflow-y: scroll;
}
#sidebar_footer {
position: fixed;
bottom: 0;
width: inherit;
}
#sidebar {
width: 250px;
min-height: 100vh;
max-height: 100vh;
}
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
<link rel="stylesheet" href="{{ url_for('static', filename='css/dashboard_test.css') }}" />
<div class="container-fluid" style="height:100%; overflow:hidden;">
<div class="row">
<div class="align-items-start text-center p-0 bg-dark text-white" id="sidebar" >
<div class="p-3">
<span class="fs-4" id="sidebar_heading">
Header
</span>
</div>
<hr>
<div class="p-3" id="sidebar_sub_header">
<ul class="nav nav-pills flex-column mb-auto">
<li class="nav-item">
<a href="#" class="nav-link active" aria-current="page">
Test 1
</a>
</li>
<li>
<a href="#" class="nav-link text-white">
Test 2
</a>
</li>
</ul>
</div>
<hr>
<div class="mb-auto p-3 bg-danger flex-fill" id="sidebar_main_content" style="height:100%; overflow-y: scroll;">
<!-- main content - scrollable -->
<ul class="nav flex-column mb-auto align-items-center">
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
</ul>
</div>
<div class="p-3" id="sidebar_footer">
<a href="#" class="btn btn-primary" id="add_bot_button" role="button" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="Test tooltip">
Test Button
</a>
<br><br>
<div class="dropup-center dropup">
<a href="#" class="d-flex align-items-center text-white text-decoration-none dropdown-toggle" id="dropdownUser1" data-bs-toggle="dropdown" aria-expanded="false">
test text here 0000000000000000000000000
</a>
<ul class="dropdown-menu dropdown-menu-dark text-small shadow" aria-labelledby="dropdownUser1">
<li><a class="dropdown-item" href="#">Delete User Info</a></li>
<li><a class="dropdown-item" href="#">Logout</a></li>
</ul>
</div>
</div>
</div>
<div class="col bg-secondary text-white" id="main_content">
One of three columns
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.3.0-alpha1/dist/js/bootstrap.bundle.min.js" integrity="sha384-w76AqPfDkMBDXo30jS1Sgez6pr3x5MlQ1ZAGC+nuZB+EYdgRZgiwxhTBTkF7CXvN" crossorigin="anonymous"></script>
I have navigation menu that contains links,
what I want to achieve is to make the whole li element clickable as a link.
so how to achieve that please?
I'm using bootstrap 3.2 library.
below is the HTML and CSS code.
User wants to able to click on the Link from anywhere inside the li html element
.navbar {
position: relative;
min-height: 40px !important;
margin-bottom: 20px;
border: none !important;
}
#navbarSupportedContent .nav-item {
text-transform: uppercase;
text-align: center;
font-weight: 800;
border-right: 1px solid #01154D;
padding: 10px 24px;
}
#navbarSupportedContent .nav-item:hover {
background-color: #DBDDFD;
color: #000 !important;
}
<div role="navigation">
<div class="container">
<div id="undefined-sticky-wrapper" class="sticky-wrapper" style="height: 42px;"><nav class="navbar navbar-expand-lg navbar-dark bg-primary sticky-top">
<div class="collapse navbar-collapse justify-content-center" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto" style="float:inherit;">
<li class="nav-item active">
<a class="nav-link" href="/webcenter/portal/dummy/pages_en">
<span id="submenu1">Home</span>
</a>
</li>
<li class="nav-item ">
<a class="nav-link" href="/webcenter/portal/dummy/pages_employeetools">
<span id="submenu1">Employee Tools</span>
</a>
</li>
<li class="nav-item ">
<div class="dropdown show">
<a style="color:#e6ecf2;" aria-expanded="false" aria-haspopup="true" class="dropdown-toggle" data-toggle="dropdown" href="#" id="dropdownMenuLink" role="button">MEDIA CENTER</a>
<div aria-labelledby="dropdownMenuLink" class="dropdown-menu">
<a class="dropdown-item" href="/webcenter/portal/dummy/pages_mediacenter/photogallery">PHOTO GALLERY</a>
<a class="dropdown-item" href="/webcenter/portal/dummy/pages_mediacenter/news1">NEWS</a>
<a class="dropdown-item" href="/webcenter/portal/dummy/pages_mediacenter/newpage">dummy MAGAZINE</a>
<a class="dropdown-item" href="/webcenter/portal/dummy/pages_mediacenter/ashurtiassagheer">dummy</a>
</div>
</div>
</li>
<li class="nav-item ">
<a class="nav-link" href="/webcenter/portal/dummy/pages_documents">
<span id="submenu1">Documents</span>
</a>
</li>
<li class="nav-item"><a data-afr-tlen="7" id="T:arabic2" class="nav-link xej" style="font-size: initial;" onclick="this.focus();return false;" data-afr-fcs="true" href="#"><span style="">العربية</span>
<i aria-hidden="true" class="fa fa-language"></i></a>
</li>
<li class="nav-item" style="margin-left: auto;"><span id="T:wcLogoutLink:spacesActionPGL" class="x1a"><a data-afr-tlen="0" id="T:wcLogoutLink:logoutLink" title="Log out of WebCenter Portal" class="nav-link glyphicon glyphicon-log-out xf0 p_AFTextOnly" style="" onclick="this.focus();return false;" data-afr-fcs="true" href="#"></a></span>
</li>
</ul><span id="T:search2" class="x1a">
<div class="navbar-form navbar-left visible-xs" id="searchxs"><div id="T:searchbox2" class="x131" aria-live="polite"><div style="display:none"><a id="T:searchbox2:_afrCommandDelegate" class="xej" onclick="this.focus();return false;" data-afr-fcs="true" href="#"></a></div></div>
</div></span>
</div>
</nav></div>
</div>
</div>
Remove li padding and add width 100% and padding to a tag
li.nav-item > a, li.nav-item > .dropdown show a{
display: block;
width: 100%;
}
.navbar {
position: relative;
min-height: 40px !important;
margin-bottom: 20px;
border: none !important;
}
li.nav-item a{ padding: 10px 0px;}
#navbarSupportedContent .nav-item {
text-transform: uppercase;
text-align: center;
font-weight: 800;
border-right: 1px solid #01154D;
padding: 0px 24px;
}
#navbarSupportedContent .nav-item:hover {
background-color: #DBDDFD;
color: #000 !important;
}
<div role="navigation">
<div class="container">
<div id="undefined-sticky-wrapper" class="sticky-wrapper" style="height: 42px;"><nav class="navbar navbar-expand-lg navbar-dark bg-primary sticky-top">
<div class="collapse navbar-collapse justify-content-center" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto" style="float:inherit;">
<li class="nav-item active">
<a class="nav-link" href="/webcenter/portal/dummy/pages_en">
<span id="submenu1">Home</span>
</a>
</li>
<li class="nav-item ">
<a class="nav-link" href="/webcenter/portal/dummy/pages_employeetools">
<span id="submenu1">Employee Tools</span>
</a>
</li>
<li class="nav-item ">
<div class="dropdown show">
<a style="color:#e6ecf2;" aria-expanded="false" aria-haspopup="true" class="dropdown-toggle" data-toggle="dropdown" href="#" id="dropdownMenuLink" role="button">MEDIA CENTER</a>
<div aria-labelledby="dropdownMenuLink" class="dropdown-menu">
<a class="dropdown-item" href="/webcenter/portal/dummy/pages_mediacenter/photogallery">PHOTO GALLERY</a>
<a class="dropdown-item" href="/webcenter/portal/dummy/pages_mediacenter/news1">NEWS</a>
<a class="dropdown-item" href="/webcenter/portal/dummy/pages_mediacenter/newpage">dummy MAGAZINE</a>
<a class="dropdown-item" href="/webcenter/portal/dummy/pages_mediacenter/ashurtiassagheer">dummy</a>
</div>
</div>
</li>
<li class="nav-item ">
<a class="nav-link" href="/webcenter/portal/dummy/pages_documents">
<span id="submenu1">Documents</span>
</a>
</li>
<li class="nav-item"><a data-afr-tlen="7" id="T:arabic2" class="nav-link xej" style="font-size: initial;" onclick="this.focus();return false;" data-afr-fcs="true" href="#"><span style="">العربية</span>
<i aria-hidden="true" class="fa fa-language"></i></a>
</li>
<li class="nav-item" style="margin-left: auto;"><span id="T:wcLogoutLink:spacesActionPGL" class="x1a"><a data-afr-tlen="0" id="T:wcLogoutLink:logoutLink" title="Log out of WebCenter Portal" class="nav-link glyphicon glyphicon-log-out xf0 p_AFTextOnly" style="" onclick="this.focus();return false;" data-afr-fcs="true" href="#"></a></span>
</li>
</ul><span id="T:search2" class="x1a">
<div class="navbar-form navbar-left visible-xs" id="searchxs"><div id="T:searchbox2" class="x131" aria-live="polite"><div style="display:none"><a id="T:searchbox2:_afrCommandDelegate" class="xej" onclick="this.focus();return false;" data-afr-fcs="true" href="#"></a></div></div>
</div></span>
</div>
</nav></div>
</div>
</div>
Do not render the <li> big, but the <a>. The anchor element already has all the bindings necessary to provide an accessible and very usable link. Rendering it bigger improves usability.
.navbar {
position: relative;
min-height: 40px !important;
margin-bottom: 20px;
border: none !important;
}
#navbarSupportedContent .nav-item {
text-transform: uppercase;
text-align: center;
font-weight: 800;
}
#navbarSupportedContent .nav-link {
display: block;
border-right: 1px solid #01154D;
padding: 10px 24px;
}
#navbarSupportedContent .nav-link:hover {
background-color: #DBDDFD;
color: #000 !important;
}
<div role="navigation">
<div class="container">
<div id="undefined-sticky-wrapper" class="sticky-wrapper" style="height: 42px;">
<nav class="navbar navbar-expand-lg navbar-dark bg-primary sticky-top">
<div class="collapse navbar-collapse justify-content-center" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto" style="float:inherit;">
<li class="nav-item active">
<a class="nav-link" href="/webcenter/portal/dummy/pages_en">
<span id="submenu1">Home</span>
</a>
</li>
<li class="nav-item ">
<a class="nav-link" href="/webcenter/portal/dummy/pages_employeetools">
<span id="submenu1">Employee Tools</span>
</a>
</li>
<li class="nav-item ">
<div class="dropdown show">
<a style="color:#e6ecf2;" aria-expanded="false" aria-haspopup="true" class="dropdown-toggle" data-toggle="dropdown" href="#" id="dropdownMenuLink" role="button">MEDIA CENTER</a>
<div aria-labelledby="dropdownMenuLink" class="dropdown-menu">
<a class="dropdown-item" href="/webcenter/portal/dummy/pages_mediacenter/photogallery">PHOTO GALLERY</a>
<a class="dropdown-item" href="/webcenter/portal/dummy/pages_mediacenter/news1">NEWS</a>
<a class="dropdown-item" href="/webcenter/portal/dummy/pages_mediacenter/newpage">dummy MAGAZINE</a>
<a class="dropdown-item" href="/webcenter/portal/dummy/pages_mediacenter/ashurtiassagheer">dummy</a>
</div>
</div>
</li>
<li class="nav-item ">
<a class="nav-link" href="/webcenter/portal/dummy/pages_documents">
<span id="submenu1">Documents</span>
</a>
</li>
<li class="nav-item"><a data-afr-tlen="7" id="T:arabic2" class="nav-link xej" style="font-size: initial;" onclick="this.focus();return false;" data-afr-fcs="true" href="#"><span style="">العربية</span>
<i aria-hidden="true" class="fa fa-language"></i></a>
</li>
<li class="nav-item" style="margin-left: auto;"><span id="T:wcLogoutLink:spacesActionPGL" class="x1a"><a data-afr-tlen="0" id="T:wcLogoutLink:logoutLink" title="Log out of WebCenter Portal" class="nav-link glyphicon glyphicon-log-out xf0 p_AFTextOnly" style="" onclick="this.focus();return false;" data-afr-fcs="true" href="#"></a></span>
</li>
</ul><span id="T:search2" class="x1a">
<div class="navbar-form navbar-left visible-xs" id="searchxs"><div id="T:searchbox2" class="x131" aria-live="polite"><div style="display:none"><a id="T:searchbox2:_afrCommandDelegate" class="xej" onclick="this.focus();return false;" data-afr-fcs="true" href="#"></a></div></div>
</div></span>
</div>
</nav>
</div>
</div>
</div>
So a simple CSS only solution would be;
Remove the padding from li element.
Make the a tag a block and give it 100% width
.navbar {
position: relative;
min-height: 40px !important;
margin-bottom: 20px;
border: none !important;
}
#navbarSupportedContent .nav-item {
text-transform: uppercase;
text-align: center;
font-weight: 800;
border-right: 1px solid #01154D;
padding: 0;
}
#navbarSupportedContent .nav-item:hover {
background-color: #DBDDFD;
color: #000 !important;
}
#navbarSupportedContent .nav-item a {
display: block;
width: 100%;
padding: 10px 24px; // removed from list and added here for same visual effect
}
<div role="navigation">
<div class="container">
<div id="undefined-sticky-wrapper" class="sticky-wrapper" style="height: 42px;"><nav class="navbar navbar-expand-lg navbar-dark bg-primary sticky-top">
<div class="collapse navbar-collapse justify-content-center" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto" style="float:inherit;">
<li class="nav-item active">
<a class="nav-link" href="/webcenter/portal/dummy/pages_en">
<span id="submenu1">Home</span>
</a>
</li>
<li class="nav-item ">
<a class="nav-link" href="/webcenter/portal/dummy/pages_employeetools">
<span id="submenu1">Employee Tools</span>
</a>
</li>
<li class="nav-item ">
<div class="dropdown show">
<a style="color:#e6ecf2;" aria-expanded="false" aria-haspopup="true" class="dropdown-toggle" data-toggle="dropdown" href="#" id="dropdownMenuLink" role="button">MEDIA CENTER</a>
<div aria-labelledby="dropdownMenuLink" class="dropdown-menu">
<a class="dropdown-item" href="/webcenter/portal/dummy/pages_mediacenter/photogallery">PHOTO GALLERY</a>
<a class="dropdown-item" href="/webcenter/portal/dummy/pages_mediacenter/news1">NEWS</a>
<a class="dropdown-item" href="/webcenter/portal/dummy/pages_mediacenter/newpage">dummy MAGAZINE</a>
<a class="dropdown-item" href="/webcenter/portal/dummy/pages_mediacenter/ashurtiassagheer">dummy</a>
</div>
</div>
</li>
<li class="nav-item ">
<a class="nav-link" href="/webcenter/portal/dummy/pages_documents">
<span id="submenu1">Documents</span>
</a>
</li>
<li class="nav-item"><a data-afr-tlen="7" id="T:arabic2" class="nav-link xej" style="font-size: initial;" onclick="this.focus();return false;" data-afr-fcs="true" href="#"><span style="">العربية</span>
<i aria-hidden="true" class="fa fa-language"></i></a>
</li>
<li class="nav-item" style="margin-left: auto;"><span id="T:wcLogoutLink:spacesActionPGL" class="x1a"><a data-afr-tlen="0" id="T:wcLogoutLink:logoutLink" title="Log out of WebCenter Portal" class="nav-link glyphicon glyphicon-log-out xf0 p_AFTextOnly" style="" onclick="this.focus();return false;" data-afr-fcs="true" href="#"></a></span>
</li>
</ul><span id="T:search2" class="x1a">
<div class="navbar-form navbar-left visible-xs" id="searchxs"><div id="T:searchbox2" class="x131" aria-live="polite"><div style="display:none"><a id="T:searchbox2:_afrCommandDelegate" class="xej" onclick="this.focus();return false;" data-afr-fcs="true" href="#"></a></div></div>
</div></span>
</div>
</nav></div>
</div>
</div>
Simple Solution, Just throw list (li) between the anchor tags (a)
<ul class="navbar-nav mr-auto" style="float:inherit;">
<a class="nav-link" href="/webcenter/portal/dummy/pages_en">
<li class="nav-item active">
<span id="submenu1">Home</span>
</li>
</a>
<a class="nav-link" href="/webcenter/portal/dummy/pages_employeetools">
<li class="nav-item ">
<span id="submenu1">Employee Tools</span>
</li>
</a>
</ul>
I'm trying to extend my navbar data-toggle dropdown to the full width of the screen. For some reason, it still leaves white space on the left side when I set the viewport width to 100. I'm using bootstrap and setting a media query in my CSS which I'll show below.
<nav class="navbar navbar-expand-sm navbar-dark fixed-top bg-primary">
<div class="container">
<a class="navbar-brand text-white">Vince Clicks</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarToggler"
aria-controls="navbarToggler" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse bg-primary" id="navbarToggler">
<ul class="navbar-nav text-center mx-auto mb-2 mb-sm-0">
<li class="nav-item">
<a class="nav-link active" href="#home">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#about">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#skills">Skills</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#contact">Contact</a>
</li>
</ul>
<div class="d-none d-sm-flex">
<a class="btn btn-social-icon btn-linkedin" href="#"><i
class="fab fa-2x fa-github-square"></i></a>
<a class="btn btn-social-icon btn-linkedin" href="http://www.linkedin.com/in/"><i
class="fab fa-2x fa-linkedin"></i></a>
</div>
</div>
</div>
</nav>
#media (max-width: 576px){
.navbar-nav{
margin-top: 11px;
max-height: 158px;
width: 100vw
}
.nav-link{
border-top: 1px solid black;
}
}
The .container has left and right padding (x-axis), remove it by adding .px-0 and your example works. There is no need to set the width in your media query.
In the following snippet, in order to compensate for the lost padding
I have added margins to .navbar-brand and .navbar-toggler
with .ms-3 and .me-3, respectively:
#media (max-width: 576px) {
.navbar-nav {
margin-top: 11px;
max-height: 158px;
}
.nav-link {
border-top: 1px solid black;
}
}
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.1.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU" crossorigin="anonymous">
<nav class="navbar navbar-expand-sm navbar-dark fixed-top bg-primary">
<div class="container px-0">
<a class="navbar-brand text-white ms-3">Vince Clicks</a>
<button class="navbar-toggler me-3" type="button" data-bs-toggle="collapse" data-bs-target="#navbarToggler" aria-controls="navbarToggler" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse bg-primary" id="navbarToggler">
<ul class="navbar-nav text-center mx-auto mb-2 mb-sm-0">
<li class="nav-item">
<a class="nav-link active" href="#home">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#about">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#skills">Skills</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#contact">Contact</a>
</li>
</ul>
<div class="d-none d-sm-flex">
<a class="btn btn-social-icon btn-linkedin" href="#"><i class="fab fa-2x fa-github-square"></i></a>
<a class="btn btn-social-icon btn-linkedin" href="http://www.linkedin.com/in/"><i class="fab fa-2x fa-linkedin"></i></a>
</div>
</div>
</div>
</nav>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.1.1/dist/js/bootstrap.bundle.min.js" integrity="sha384-/bQdsTh/da6pkI1MST/rWKFNjaCP5gBSY4sEBT38Q/9RBh9AH40zEOg7Hlq2THRZ" crossorigin="anonymous"></script>
I am using Bootrstap 4 and I cannot figure out why my active class is not working. I have followed examples and documentation but I am still having issues figuring out why it is not working.
My head tag conains jquery then popper then bootstrap in index.html.
COMPONENT.HTML
<!--COMPONENT.HTML-->
<nav class="navbar navbar-expand-lg navbar-dark navbar-custom">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarTop"
aria-controls="navbarTop" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarTop">
<ul class="nav navbar-nav w-100">
<li class="nav-item ml-4">
<a class="nav-link active" data-toggle="collapse" data-target=".navbar-collapse.show"
routerLink="">Home<span class="sr-only">(current)</span></a>
</li>
<li class="nav-item ml-4">
<a class="nav-link" data-toggle="collapse" data-target=".navbar-collapse.show"
routerLink="/landscaping">Landscaping</a>
</li>
<li class="nav-item ml-4">
<a class="nav-link" data-toggle="collapse" data-target=".navbar-collapse.show"
routerLink="/fences-decks">Fences & Decks</a>
</li>
<li class="nav-item ml-4">
<a class="nav-link" data-toggle="collapse" data-target=".navbar-collapse.show"
routerLink="/sprinkler">Sprinklers</a>
</li>
<li class="nav-item ml-4">
<a class="nav-link" data-toggle="collapse" data-target=".navbar-collapse.show"
routerLink="/remodeling">Remodeling</a>
</li>
<li class="nav-item ml-4">
<a class="nav-link" data-toggle="collapse" data-target=".navbar-collapse.show"
routerLink="/concrete">Concrete</a>
</li>
<!-- <li class="nav-item ml-4">
<a class="nav-link" routerLink="/reviews">Google Reviews</a>
</li> -->
<li class="nav-item ml-4">
<a class="nav-link" data-toggle="collapse" data-target=".navbar-collapse.show"
routerLink="/about">About</a>
</li>
<br>
<div class="text-right ml-auto">
<li class="nav-item">
<a class="nav-link text-info" data-toggle="modal" data-target="#emailForm"><span class="material-icons lightgrey">email</span> user#email.com</a>
</li>
<li class="nav-item">
<a class="nav-link text-info" href="tel:1-801-759-4477"><span class="material-icons lightgrey">phone_in_talk</span> 801-759-4477</a>
</li>
</div>
</ul>
<script>
$("#navbarTop .nav .nav-item").on("click", function(){
$(".nav-link").find(".active").removeClass("active");
$(this).addClass("active");
});
</script>
</div>
</nav>
$(document).ready(function() {
$(".nav-item a").click(function() {
let active = $(".active-nav-item")
if (active) {
$(active).removeClass("active-nav-item");
$(this).parent().addClass("active-nav-item");
}
})
})
#topbar {
.topbar-social-list {
display: flex;
list-style: none;
padding: 0;
margin: 0;
text-align: center;
.topbar-social-list-item {
cursor: pointer;
transition: all 0.3s;
i {
transition: all 0.3s;
}
& i:hover {
transition: all 0.3s;
color: white !important;
}
}
}
}
.nav-sec {
background-color: rgb(14, 13, 13) !important;
.dropdown {
&:hover {
.dropdown-menu {
display: block; // left: -10px; border-radius: 0% !important; } } } .nav-list{ .nav-list-item{ transition: all 0.3s; &:hover{ transition: all 0.3s; background-color:
red !important;
a {
color: blue !important;
}
}
}
}
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<section id="topbar" class="bg-dark">
<div class="container">
<div class="row">
<div class="col d-flex p-2">
<div class="topbar-mail me-3">
<i class="fa-solid fa-envelope text-danger"></i>
<span class="text-secondary">
info#example.com
</span>
</div>
<div class="topbar-phone">
<i class="fa-solid fa-mobile text-danger"></i>
<span class="text-secondary">
+1 5589 55488 55
</span>
</div>
</div>
<div class="col d-flex justify-content-end">
<ul class="topbar-social-list align-items-center">
<li class="topbar-social-list-item">
<i class="fa-brands fa-twitter text-secondary text-center me-3"></i>
</li>
<li class="topbar-social-list-item">
<i class="fa-brands fa-facebook text-secondary text-center me-3"></i>
</li>
<li class="topbar-social-list-item">
<i class="fa-brands fa-instagram text-secondary text-center me-3"></i>
</li>
<li class="topbar-social-list-item">
<i class="fa-brands fa-linkedin text-secondary text-center me-3"></i>
</li>
</ul>
</div>
</div>
</div>
</section>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark nav-sec p-0">
<div class="container">
<a class="navbar-brand fs-2 fw-bold" href="#">DAY</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNavDropdown" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse justify-content-end nav-list" id="navbarNavDropdown">
<ul class="navbar-nav">
<li class="nav-item nav-list-item p-lg-3 active-nav-item">
<a class="nav-link active" aria-current="page" href="#">Home</a>
</li>
<li class="nav-item nav-list-item p-lg-3">
<a class="nav-link" href="#">Features</a>
</li>
<li class="nav-item nav-list-item p-lg-3">
<a class="nav-link" href="#">Pricing</a>
</li>
<li class="nav-item nav-list-item dropdown p-lg-3">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown link
</a>
<ul class="dropdown-menu mt-3" aria-labelledby="navbarDropdownMenuLink">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
</ul>
</li>
<li class="nav-item nav-list-item p-lg-3">
<a class="nav-link" href="#">Contact</a>
</li>
</ul>
</div>
</div>
</nav>
This is a question similar to this one, but it is for Bootstrap 4.
I am not able to add right-justified entries on the BS4 navbar that stay visible both when collapsed and not collapsed. I spent one full afternoon without success.
This is my goal:
Here my current code (that works only when not collapsed):
<nav class="navbar navbar-light navbar-expand-xl border-bottom mainmenu sticky-top">
<a class="navbar-brand text-capitalize text-blur" href="/">
<img class="mr-1" src="/images/logo/favicon-32x32.png" alt="Logo">
<span class="">Portami in Pista</span>
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#myTopMenu"
aria-controls="collapsableTopMen" aria-expanded="false" aria-label="[Menu]">
<span class="sr-only">[Menu]</span>
<span class="navbar-toggler-icon" title="[Menu]"/>
</button>
<div class="collapse navbar-collapse" id="collapsableTopMen">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="/Schools/">
<i class="fa fa-motorcycle fa-rotate-315 text-danger" aria-hidden="true"/>
<span class="text-blur-danger">PiP Reparto Corse</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/Tracks/">
<i class="fa fa-flag-checkered text-primary" aria-hidden="true"/>
<span>Piste</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/Blog/le-guide-del-giovedi/">
<i class="fa fa-mortar-board text-primary" aria-hidden="true"/>
<span>Le guide del giovedì</span>
</a>
</li>
</ul>
<ul class="navbar-nav ml-auto">
<!- START of section should be always visible -->
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownLang" role="button"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="famfamfam-flags it" title="Italiano"/>
<span class="d-inline d-xl-none">Italiano</span>
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownLang">
<a class="dropdown-item" href="/AbpLocalization/ChangeCulture?cultureName=en&returnUrl=/">
<i class="famfamfam-flags gb" aria-hidden="true"/>
<span class="">English</span>
</a>
</div>
</li>
<!- END of section should be always visible -->
<li class="nav-item">
<a class="nav-link" href="/Account/Login"><i class="fa fa-sign-in"/> Log in</a>
</li>
</ul>
</div>
</nav>
Since you're using Bootstrap 4, this answer is more relevant to your question:
https://stackoverflow.com/a/41513784/171456 (see the last part)
The part that you always want to keep visible needs to be separate from any of the collapsible parts. Then use the order-* classes to position the items as desired:
Demo: https://codeply.com/p/ylDhhZtpiH
<nav class="navbar navbar-light navbar-expand-xl border-bottom mainmenu sticky-top justify-content-start">
<a class="navbar-brand text-capitalize text-blur" href="/">
<img class="mr-1" src="//placehold.it/32" alt="Logo">
<span class="">Portami in Pista</span>
</a>
<button class="navbar-toggler order-2 ml-1" type="button" data-toggle="collapse" data-target=".collapsable" aria-controls="collapsableTopMen" aria-expanded="false" aria-label="[Menu]">
<span class="sr-only">[Menu]</span>
<span class="navbar-toggler-icon" title="[Menu]"></span>
</button>
<!-- 1st collapse menu -->
<div class="collapse navbar-collapse collapsable flex-grow-0 flex-xl-grow-1 order-last" id="collapsableTopMen">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="/Schools/">
<i class="fa fa-motorcycle fa-rotate-315 text-danger" aria-hidden="true"></i>
<span class="text-blur-danger">PiP Reparto Corse</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/Tracks/">
<i class="fa fa-flag-checkered text-primary" aria-hidden="true"></i>
<span>Piste</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/Blog/le-guide-del-giovedi/">
<i class="fa fa-mortar-board text-primary" aria-hidden="true"></i>
<span>Le guide del giovedì</span>
</a>
</li>
</ul>
</div>
<!-- always visible portion -->
<ul class="navbar-nav order-1 order-xl-last ml-auto">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownLang" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-flag it" title="Italiano"></i>
<span class="d-inline d-xl-none">Italiano</span>
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownLang">
<a class="dropdown-item" href="#">
<i class="fas fa-flag-usa gb" aria-hidden="true"></i>
<span class="">English</span>
</a>
</div>
</li>
</ul>
<!-- 2nd collapse menu -->
<div class="collapse navbar-collapse collapsable flex-grow-0 order-last">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="/Account/Login"><i class="fa fa-sign-in"></i> Log in</a>
</li>
</ul>
</div>
</nav>
https://codeply.com/p/ylDhhZtpiH
I did a small important fix to the good answer from Zim.
I fixed the "always visible" portion of the menu as he did not overlap the whole menu when it was collapsed.
Adding a custom .navbar-always-overlapped class, fixed it.
<nav class="navbar navbar-light navbar-expand-lg border-bottom mainmenu sticky-top justify-content-start">
<!-- same code from Zim here>
...
<!-- always visible portion. Note the 'navbar-always-overlapped' -->
<ul class="navbar-nav navbar-always-overlapped order-1 order-lg-last ml-auto">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownLang" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-flag it" title="Italiano"></i>
<span class="d-inline d-lg-none">Italiano</span>
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownLang">
<a class="dropdown-item" href="#">
<i class="fas fa-flag-usa gb" aria-hidden="true"></i>
<span class="">English</span>
</a>
</div>
</li>
</ul>
<!-- 2nd collapse menu -->
<div class="collapse navbar-collapse collapsable flex-grow-0 order-last">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="/Account/Login"><i class="fa fa-sign-in"></i> Log in</a>
</li>
</ul>
</div>
</nav>
and the code for .navbar-always-overlapped:
.navbar-always-overlapped .dropdown-menu {
position: absolute !important;
}
See https://codeply.com/p/9deLYTGblZ