Dropdown bootstrap move all item of my navbar - html

I've create a navbar for my website. But I don't understand very well how work the positionning items with bootstrap. And I have a problem, when I click on my dropdown button (profil image), all items of my navbar move and I don't want that :
https://www.codeply.com/p/OlyRp40cOH
HTML :
<div class="pos-f-t">
<nav class="navbar fixed-top navbar-custom" style="height: 80px;">
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarToggleExternalContent" aria-controls="navbarToggleExternalContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" href="#">
<img src="assets/img/logo.png" alt="LOGO" style="height: 50px"> Title
</a>
<form class="mx-2 my-auto d-inline w-50">
<input class="form-control mr-sm-6" type="search" placeholder="Search..." aria-label="Search" id="searchBar">
</form>
<ul class="navbar-nav ml-auto">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" id="navbarDropdownMenuLink" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
<img src="https://mdbootstrap.com/img/Photos/Avatars/avatar-2.jpg" class="rounded-circle z-depth-0"
alt="avatar image" style="height: 50px; outline-width: 10px; outline-color: white">
</a>
<div class="dropdown-menu"
aria-labelledby="navbarDropdownMenuLink">
<a class="dropdown-item" href="#">My account</a>
<a class="dropdown-item" href="#">Disconnect</a>
</div>
</li>
</ul>
</nav>
</div>
CSS :
.navbar-custom {
background-color: #2c3e50;
color: white;
font-weight: bold;
font-variant-caps: small-caps;
}
.navbar-toggler-icon {
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255,255,255, 1)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 8h24M4 16h24M4 24h24'/%3E%3C/svg%3E");
}
.navbar-toggler-icon:hover {
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255,176,43, 1)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 8h24M4 16h24M4 24h24'/%3E%3C/svg%3E");
}
.navbar-brand {
margin-left: 2%;
font-size: 30px;
color: white
}
.navbar-brand:hover {
color: #ffb02b;
}
#searchBar {
border-radius: 20px;
font-family:Arial, 'Font Awesome 5 Free'
}
#searchBar:focus {
border-color: #ffb02b;
border-width: 2px;
}

you have a problem with "navbar-nav" class in <ul> change that class with "nav"
<ul class="nav ml-auto">

Related

How to change the background colour for nav-bar dropdown menu?

Im trying to expand the size of the dropdown menu but most of all im trying to change the background colour, I can only seem to change the colour of the links and the area around the links.
.navbar a {
width: 125px;
text-align: center;
color: rgb(173, 173, 173);
}
.nav-link:hover {
color: rgb(238, 176, 94);
}
.dropdown-menu .dropdown-item {
text-align: left;
background-color: aqua;
}
.dropdown-menu a {
color: rgb(48, 58, 78);
background-color: aqua;
}
.dropdown-menu>a:hover {
background-image: none;
background-color: rgb(255, 255, 255);
text-align: center;
}
<!-- Bootstrap-4 + Fontawesome -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap#4.5.3/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
<script src="https://kit.fontawesome.com/c719673ce3.js" crossorigin="anonymous"></script>
<!-- Body -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<button class="navbar-toggler" 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" id="navbarNavDropdown">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="Home.html">Home</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbardrop" data-toggle="dropdown">
My Projects
</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="Python.html">Python</a>
<a class="dropdown-item" href="PixelArt.html">Pixel Art</a>
<a class="dropdown-item" href="Website.html">Websites</a>
<a class="dropdown-item" href="raspi.html">Raspberry Pi</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="Portfolio.html">My Portfolio</a>
</li>
</ul>
</div>
</nav>
<!-- Jquery -->
<script src="https://code.jquery.com/jquery-3.6.0.js" integrity="sha256-H+K7U5CnXl1h5ywQfKtSj8PCmoN9aaq30gDh27Xc0jk=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#4.5.3/dist/js/bootstrap.min.js" integrity="sha384-w1Q4orYjBQndcko6MimVbzY0tgp4pWB4lZ7lr30WKz0vr/aWKhXdBNmNb5D92v7s" crossorigin="anonymous"></script>
This is the dropdown menu. I want to colour in the white, and expand the size of the dropdown menu. If this is possible, what should I do?
In your code
.dropdown-menu .dropdown-item {
text-align: left;
background-color: aqua;
}
you used this which makes the .dropdown-item background in aqua color. If you only want the rgba(0,0,0,1) which is a white color in your background, you only need to remove the background-color:aqua from here. And to change the size of your dropdown menu, you can use width CSS property.
if you want to change all the background color to aqua
.dropdown-menu .dropdown-item {
text-align: left;
background-color: aqua;
}
.dropdown-menu a {
color: rgb(48, 58, 78);
background-color : aqua;
}
if you want to change all the color to white
.dropdown-menu .dropdown-item {
text-align: left;
background-color: #fff;
}
.dropdown-menu a {
color: rgb(48, 58, 78);
background-color : #fff;
}
For the background color you just need to set the rule for a .dropdown-menu inside a .nav-item
.nav-item .dropdown-menu {
background-color: aqua;
}
This selector is specific enough to override the BS style for .dropdown-menu.
Then expand the .dropdown-items to take up the full width of the .dropdown-menu as follows:
.dropdown-menu .dropdown-item {
/* ... */
width: 100%;
}
.navbar a {
width: 125px;
text-align: center;
color: rgb(173, 173, 173);
}
.nav-link:hover {
color: rgb(238, 176, 94);
}
.nav-item .dropdown-menu {
background-color: aqua;
}
.dropdown-menu .dropdown-item {
text-align: left;
width: 100%;
}
.dropdown-menu a {
color: rgb(48, 58, 78);
}
.dropdown-menu>a:hover {
background-image: none;
background-color: rgb(255, 255, 255);
text-align: center;
}
<!-- Bootstrap-4 + Fontawesome -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap#4.5.3/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
<script src="https://kit.fontawesome.com/c719673ce3.js" crossorigin="anonymous"></script>
<!-- Body -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<button class="navbar-toggler" 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" id="navbarNavDropdown">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="Home.html">Home</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbardrop" data-toggle="dropdown">
My Projects
</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="Python.html">Python</a>
<a class="dropdown-item" href="PixelArt.html">Pixel Art</a>
<a class="dropdown-item" href="Website.html">Websites</a>
<a class="dropdown-item" href="raspi.html">Raspberry Pi</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="Portfolio.html">My Portfolio</a>
</li>
</ul>
</div>
</nav>
<!-- Jquery -->
<script src="https://code.jquery.com/jquery-3.6.0.js" integrity="sha256-H+K7U5CnXl1h5ywQfKtSj8PCmoN9aaq30gDh27Xc0jk=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#4.5.3/dist/js/bootstrap.min.js" integrity="sha384-w1Q4orYjBQndcko6MimVbzY0tgp4pWB4lZ7lr30WKz0vr/aWKhXdBNmNb5D92v7s" crossorigin="anonymous"></script>

How do I stop my dropdown menu from jumping left to right?

I'm using bootstrap's responsive navbar, in mobile devices it displays a dropdown menu. This menu, be default, is aligned to the left. I changed this so that is displays to the right. I did achieve this. However, when I test on my iPhone (XR), the dropdown first shows on the left and quickly moves to the right, on its own. How can I stop this?
You can see a small video of what's happening here.
/* Navbar */
.navbar-light .navbar-toggler {
color:rgba(46, 46, 46, 1);
border-color: transparent;
}
.navbar-custom {
background-color: #ffffff;
}
.navbar-custom .navbar-brand img {
width: 75%;
}
.navbar-light .navbar-nav .nav-link {
color: rgba(46, 46, 46, 1);
font-size: 0.9em;
text-transform: capitalize;
font-weight: 600;
border-radius: 0;
}
.navbar-light .navbar-nav .nav-link:hover {
color: #DA3D0D;
text-decoration: none;
}
.navbar-custom-dropdown {
border-radius: 0;
}
.navbar-custom-dropdown li a {
font-weight: 600;
line-height: 2em;
font-size: 0.9em;
}
.navbar-custom-dropdown li a:hover,
.navbar-custom-dropdown li a:focus {
background-color: #ffffff;
color: #DA3D0D;
}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap#4.6.0/dist/css/bootstrap.min.css" integrity="sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l" crossorigin="anonymous">
<!-- NAVBAR -->
<nav class="navbar navbar-expand-lg navbar-light navbar-custom">
<a class="navbar-brand" href="index.html">
<img src="images/logo-briones-monolithic.svg" alt="Briones Monolithic">
</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 navbar-custom-link" id="navbarTogglerDemo02">
<ul class="navbar-nav ml-auto mt-2 mt-lg-0">
<li class="nav-item active">
<a class="nav-link" href="#">INICIO</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">PROYECTOS</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarScrollingDropdown" role="button" data-toggle="dropdown" aria-expanded="false">
GRUPO MONOLITHIC
</a>
<ul class="dropdown-menu navbar-custom-dropdown" aria-labelledby="navbarScrollingDropdown">
<li><a class="dropdown-item" href="#">BRIONES MONOLITHIC</a></li>
<li><a class="dropdown-item" href="#">BE MONOLITHIC</a></li>
<li><a class="dropdown-item" href="#">ELECTRIC MONOLITHIC</a></li>
<li><a class="dropdown-item" href="#">GRUPO MONOLITHIC</a></li>
</ul>
</li>
<li class="nav-item">
<a class="nav-link" href="#">CONTACTO</a>
</li>
</ul>
</div>
</nav>
<!-- /NAVBAR -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#4.6.0/dist/js/bootstrap.bundle.min.js" integrity="sha384-Piv4xVNRyMGpqkS2by6br4gNJ7DXjqk09RmUpJ8jgGtD7zP9yug3goQfGII0yAns" crossorigin="anonymous"></script>

Full height two column and header with Bootstrap 4

I'm in trouble with a web page that I would like to get with a two column that are full height and a header with a navbar. But I cannot obtain the effect because the columns scroll under the header.
This is my html
<body>
<nav class="navbar navbar-custom navbar-expand-lg fixed-top py-0">
<a class="navbar-brand" href="#">
<img src="~/images/icona-64.png" width="32" height="32" alt="brand">
brand
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar-list-4" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbar-list-4">
<ul class="navbar-nav">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<img src="~/images/icona-64.png" width="40" height="40" class="rounded-circle">
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<a class="dropdown-item" href="#">Dashboard</a>
<a class="dropdown-item" href="#">Edit Profile</a>
<a class="dropdown-item" href="#">Log Out</a>
</div>
</li>
</ul>
</div>
</nav>
<div id="appContainer" class="container-fluid d-flex px-0" style="min-height: 100%;">
<div class="dpPanelSx bg-info vh-100">Panel Sx</div>
<div class="dpPanelDx vh-100">Panel Dx</div>
</div>
<footer>
</footer>
</body>
The CSS
body, html {
height: 100%;
}
/* set custom color for the nav bar*/
.navbar-custom {
background-color: #034c67; /*#213B52;*/
}
/* change the brand and text color */
.navbar-custom .navbar-brand,
.navbar-custom .navbar-text {
color: rgba(255,255,255,.8);
}
/* change the link color */
.navbar-custom .navbar-nav .nav-link {
color: rgba(255,255,255,.5);
}
/* change the color of active or hovered links */
.navbar-custom .nav-item.active .nav-link,
.navbar-custom .nav-item:hover .nav-link {
color: #ffffff;
}
.dpPanelSx {
flex: 1;
}
.dpPanelDx {
flex: 1;
}
And I added a javascript to force the height of the column to the height of the body
$(document).ready(setupApplication);
function setupApplication() {
// set the containter size
resizeContainer();
// setup eventlistener
$(window).resize(resizeContainer);
}
function resizeContainer() {
var viewH = document.body.clientHeight;
var viewW = $(window).width();
var headHeight = $('nav').height();
console.log('body: ' + document.body.clientHeight);
console.log('window: ' + window.innerHeight);
try {
$('body').css('padding-top', headHeight);
// $('#appContainer').height(viewH - headHeight);
}
catch { }
}
I definitely not able to obtain my desidered effect.
I need a page that is full size height, can you help please?
Thank you
You probably don't need the javascript to achieve it. I have removed fixed-top on your nav.
body,
html {
height: 100%;
}
/* set custom color for the nav bar*/
.navbar-custom {
background-color: #034c67;
/*#213B52;*/
}
/* change the brand and text color */
.navbar-custom .navbar-brand,
.navbar-custom .navbar-text {
color: rgba(255, 255, 255, .8);
}
/* change the link color */
.navbar-custom .navbar-nav .nav-link {
color: rgba(255, 255, 255, .5);
}
/* change the color of active or hovered links */
.navbar-custom .nav-item.active .nav-link,
.navbar-custom .nav-item:hover .nav-link {
color: #ffffff;
}
.dpPanelSx {
flex: 1;
}
.dpPanelDx {
flex: 1;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js#1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
<body>
<nav class="navbar navbar-custom navbar-expand-lg py-0">
<a class="navbar-brand" href="#">
<img src="~/images/icona-64.png" width="32" height="32" alt="brand"> brand
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar-list-4" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbar-list-4">
<ul class="navbar-nav">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<img src="~/images/icona-64.png" width="40" height="40" class="rounded-circle">
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<a class="dropdown-item" href="#">Dashboard</a>
<a class="dropdown-item" href="#">Edit Profile</a>
<a class="dropdown-item" href="#">Log Out</a>
</div>
</li>
</ul>
</div>
</nav>
<div id="appContainer" class="container-fluid d-flex px-0" style="min-height: 100%;">
<div class="dpPanelSx bg-info vh-100">Panel Sx</div>
<div class="dpPanelDx bg-success vh-100">Panel Dx</div>
</div>
<footer>
</footer>
</body>
I made some changes to create 2 columns on your page. You can implement these to your codes.
Changes in HTML:
<div id="appContainer" class="container-fluid d-flex px-0">
<div class="dpPanelSx bg-info vh-50">Panel Sx</div>
<div class="dpPanelDx vh-50">Panel Dx</div>
</div>
Changes in CSS(Colors were added just to see the columns):
.container-fluid {
columns: auto;
columns: 2;
height: 100%;
}
.dpPanelSx {
column-width: auto;
height: 100%;
text-align: center;
background-color: green;
}
.dpPanelDx {
column-width: auto;
height: 100%;
text-align: center;
background-color: blue;
}

Boostrap center nav items

Hello I'd like to ask how i can center, these thing: Home, forum, stats, etc.. to center of screen. I've tried many functions but no one of these were working for me. And second problem is that background border button, when i point at text, with button texting gonna move to right. screen
Thanks for some advices.
.navbar-default {
background-color: rgb(48, 48, 48);
}
.navbar-nav {
font-size: 20px
}
.custom-toggler {
border-color: white;
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='-9 0 35 33' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255, 255, 255, 0.8)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 8h24M4 16h24M4 24h24'/%3E%3C/svg%3E");
}
.nav-tabs>li>a:hover {
background-color: purple !important;
border: medium none;
border-radius: 0;
color: #fff;
}
.nav-item {
color: white;
font-size: 22px;
display: block;
}
.nav-item:hover {
border-radius: 12px;
background: rgb(80, 80, 80);
padding: 5px;
width: 100px;
height: 50px;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" rel="stylesheet"/>
<nav class="navbar navbar-expand-lg navbar-default navbar-custom ">
<a class="navbar-brand" href="http://nextron.fakaheda.eu">
<img src="http://nextron.fakaheda.eu/img/nextron.png" alt="Nextron Logo" width="155" height="43">
</a>
<button class="navbar-toggler custom-toggler" type="button" data-toggle="collapse" data-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavAltMarkup">
<ul class="nav navbar-nav">
<li class="text"><a class="nav-item nav-link" style="color:white" href="#">Home</a></li>
<li class="text"><a class="nav-item nav-link" style="color:white" href="#">Forum</a></li>
<li class="text"><a class="nav-item nav-link" style="color:white" href="#">Banlist</a></li>
<li class="text"><a class="nav-item nav-link" style="color:white" href="#">Servers</a></li>
<li class="text"><a class="nav-item nav-link" style="color:white" href="#">Statistics</a></li>
<li class="text"><a class="nav-item nav-link" style="color:white" href="#">VIP</a></li>
</ul>
</div>
</nav>
In order to center nav-item use class of mx-auto to align them center. To View Output open result in new tab (full screen)
I have also overwrite bootstrap class of .navbar-nav
.navbar-nav {
font-size: 20px;
width:75% !important;
display:flex !important;
justify-content:space-evenly !important;
align-items:center !important;
}
.navbar-default {
background-color: rgb(48, 48, 48);
}
.navbar-nav {
font-size: 20px;
width:75% !important;
display:flex !important;
justify-content:space-evenly !important;
align-items:center !important;
}
.custom-toggler {
border-color: white;
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='-9 0 35 33' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255, 255, 255, 0.8)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 8h24M4 16h24M4 24h24'/%3E%3C/svg%3E");
}
.nav-tabs>li>a:hover {
background-color: purple !important;
border: medium none;
border-radius: 0;
color: #fff;
}
.nav-item {
color: white;
font-size: 22px;
display: block;
}
.nav-item:hover {
border-radius: 12px;
background: rgb(80, 80, 80);
padding: 5px;
width: 100px;
height: 50px;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<nav class="navbar navbar-expand-lg navbar-default navbar-custom ">
<a class="navbar-brand" href="http://nextron.fakaheda.eu">
<img src="http://nextron.fakaheda.eu/img/nextron.png" alt="Nextron Logo" width="155" height="43">
</a>
<button class="navbar-toggler custom-toggler" type="button" data-toggle="collapse" data-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavAltMarkup">
<ul class="nav navbar-nav mx-auto">
<li class="text"><a class="nav-item nav-link" style="color:white" href="#">Home</a></li>
<li class="text"><a class="nav-item nav-link" style="color:white" href="#">Forum</a></li>
<li class="text"><a class="nav-item nav-link" style="color:white" href="#">Banlist</a></li>
<li class="text"><a class="nav-item nav-link" style="color:white" href="#">Servers</a></li>
<li class="text"><a class="nav-item nav-link" style="color:white" href="#">Statistics</a></li>
<li class="text"><a class="nav-item nav-link" style="color:white" href="#">VIP</a></li>
</ul>
</div>
</nav>
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js#1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>

How to add animation to hamburger menu Bootstrap 4?

I am working on a website where I'd like to add an animation to my static navbar from Bootstrap. I want the 3 horizontal bars to change to an X when the button is toggled on mobile viewport.
Note: I am using Bootstrap 4, not 3. Some BS3 classes don't work in BS4
This is what I am trying to accomplish: example. However, I've found multiple tutorials but I am struggling with it. The reason for this is that all those tutorials are based on BS3. BS3 uses the navbar-toggle-class, but BS4 uses the navbar-toggler-class. It's major difference, since the BS4-version contains a viewbox in css:
.navbar-toggler {
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(0, 0, 0, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 8h24M4 16h24M4 24h24'/%3E%3C/svg%3E");
border-color: rgba(0,0,0,.1);
}
And in the bootstrap.min.css the navbar-toggler-class is being used for 11 times. So if I modify this class, it will (probably) break.
HTML of menu:
<div class="container">
<div class="row hidden-lg-up">
<div class="wrapper-right">
<img src="img/placeholders/225x50.png" alt="Logo Company Mobile" class="mobile-only" />
</div>
</div>
<div class="row">
<nav class="navbar navbar-light navbar-full">
<button class="navbar-toggler hidden-lg-up" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation"></button>
<div class="collapse navbar-toggleable-md" id="navbarResponsive">
<a class="navbar-brand vc-parent" href="#">
<img src="img/placeholders/250x50.png" alt="Logo Company Desktop" class="img-fluid desktop-only" />
</a>
<ul class="nav navbar-nav navbar-right">
<li class="nav-item active align-middle">
<a class="nav-link" href="#">Home</a>
</li>
<li class="nav-item align-middle">
<a class="nav-link" href="#">Item</a>
</li>
<li class="nav-item align-middle">
<a class="nav-link" href="#">Item</a>
</li>
</ul>
</div>
</nav>
</div>
</div>
Could anyone point me in the right direction?
Change .navbar-toggler-icon background when menu is opened to
background-image:url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='white' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 8l20 16M4 24L24 8'/%3E%3C/svg%3E");