"Navbar resposnive sidebar bootstrap 5"
Bootstrap 4.1.1 Snippet by Shivamsemisetia

<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <!doctype html> <html lang="en"> <head> <!-- Required meta tags --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,700" rel="stylesheet"> <link rel="stylesheet" href="fonts/icomoon/style.css"> <link rel="stylesheet" href="css/owl.carousel.min.css"> <!-- Bootstrap CSS --> <link rel="stylesheet" href="css/bootstrap.min.css"> <!-- Style --> <link rel="stylesheet" href="css/style.css"> <title>Website Menu #3</title> </head> <body> <div class="site-mobile-menu"> <div class="site-mobile-menu-header"> <div class="site-mobile-menu-close mt-3"> <span class="icon-close2 js-menu-toggle"></span> </div> </div> <div class="site-mobile-menu-body"></div> </div> <header class="site-navbar" role="banner"> <div class="container"> <div class="row align-items-center"> <div class="col-11 col-xl-2"> <h1 class="mb-0 site-logo"><a href="index.html" class="text-white mb-0">Brand</a></h1> </div> <div class="col-12 col-md-10 d-none d-xl-block"> <nav class="site-navigation position-relative text-right" role="navigation"> <ul class="site-menu js-clone-nav mr-auto d-none d-lg-block"> <li class="active"><a href="index.html"><span>Home</span></a></li> <li class="has-children"> <a href="about.html"><span>Dropdown</span></a> <ul class="dropdown arrow-top"> <li><a href="#">Menu One</a></li> <li><a href="#">Menu Two</a></li> <li><a href="#">Menu Three</a></li> <li class="has-children"> <a href="#">Dropdown</a> <ul class="dropdown"> <li><a href="#">Menu One</a></li> <li><a href="#">Menu Two</a></li> <li><a href="#">Menu Three</a></li> <li><a href="#">Menu Four</a></li> </ul> </li> </ul> </li> <li><a href="listings.html"><span>Listings</span></a></li> <li><a href="about.html"><span>About</span></a></li> <li><a href="blog.html"><span>Blog</span></a></li> <li><a href="contact.html"><span>Contact</span></a></li> </ul> </nav> </div> <div class="d-inline-block d-xl-none ml-md-0 mr-auto py-3" style="position: relative; top: 3px;"><a href="#" class="site-menu-toggle js-menu-toggle text-white"><span class="icon-menu h3"></span></a></div> </div> </div> </div> </header> <div class="hero" style="background-image: url('images/hero_1.jpg');"></div> <script src="js/jquery-3.3.1.min.js"></script> <script src="js/popper.min.js"></script> <script src="js/bootstrap.min.js"></script> <script src="js/jquery.sticky.js"></script> <script src="js/main.js"></script> </body> </html>
body { font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; background-color: #000; height: 6000px; position: relative; } body:before { content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.5); -webkit-transition: 0.3s all ease; -o-transition: 0.3s all ease; transition: 0.3s all ease; opacity: 0; visibility: hidden; z-index: 1; } body.offcanvas-menu:before { opacity: 1; visibility: visible; } p { color: #b3b3b3; font-weight: 300; } h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; } a { -webkit-transition: 0.3s all ease; -o-transition: 0.3s all ease; transition: 0.3s all ease; } a, a:hover { text-decoration: none !important; } .hero { height: 100vh; width: 100%; background-size: cover; background-position: center center; background-repeat: no-repeat; } .site-navbar { margin-bottom: 0px; z-index: 1999; position: absolute; top: 2rem; width: 100%; } .site-navbar.transparent { background: transparent; } .site-navbar.absolute { position: absolute; top: 0; left: 0; width: 100%; } .site-navbar .site-logo { position: relative; left: 0; font-size: 24px !important; } .site-navbar .site-navigation .site-menu { margin-bottom: 0; } .site-navbar .site-navigation .site-menu .active > a span { background: #007bff; color: #fff; border-radius: 30px; display: inline-block; padding: 5px 20px; } .site-navbar .site-navigation .site-menu a { text-decoration: none !important; display: inline-block; } .site-navbar .site-navigation .site-menu > li { display: inline-block; } .site-navbar .site-navigation .site-menu > li > a { padding: 10px 0px; color: #fff; font-size: 16px; text-decoration: none !important; } .site-navbar .site-navigation .site-menu > li > a > span { padding: 5px 20px; display: inline-block; -webkit-transition: 0.3s all ease; -o-transition: 0.3s all ease; transition: 0.3s all ease; border-radius: 30px; } .site-navbar .site-navigation .site-menu > li > a:hover > span { background: #007bff; color: #fff; border-radius: 30px; display: inline-block; } .site-navbar .site-navigation .site-menu .has-children { position: relative; } .site-navbar .site-navigation .site-menu .has-children > a span { position: relative; padding-right: 30px; } .site-navbar .site-navigation .site-menu .has-children > a span:before { position: absolute; content: "\e313"; font-size: 16px; top: 50%; right: 10px; -webkit-transform: translateY(-50%); -ms-transform: translateY(-50%); transform: translateY(-50%); font-family: "icomoon"; } .site-navbar .site-navigation .site-menu .has-children .dropdown { visibility: hidden; opacity: 0; top: 100%; position: absolute; text-align: left; border-top: 2px solid #007bff; -webkit-box-shadow: 0 2px 10px -2px rgba(0, 0, 0, 0.1); box-shadow: 0 2px 10px -2px rgba(0, 0, 0, 0.1); padding: 0px 0; margin-top: 20px; margin-left: 0px; background: #fff; -webkit-transition: 0.2s 0s; -o-transition: 0.2s 0s; transition: 0.2s 0s; } .site-navbar .site-navigation .site-menu .has-children .dropdown.arrow-top { position: absolute; } .site-navbar .site-navigation .site-menu .has-children .dropdown.arrow-top:before { bottom: 100%; left: 20%; border: solid transparent; content: " "; height: 0; width: 0; position: absolute; pointer-events: none; } .site-navbar .site-navigation .site-menu .has-children .dropdown.arrow-top:before { border-color: rgba(136, 183, 213, 0); border-bottom-color: #fff; border-width: 10px; margin-left: -10px; } .site-navbar .site-navigation .site-menu .has-children .dropdown a { text-transform: none; letter-spacing: normal; -webkit-transition: 0s all; -o-transition: 0s all; transition: 0s all; color: #343a40; } .site-navbar .site-navigation .site-menu .has-children .dropdown .active > a { color: #007bff !important; } .site-navbar .site-navigation .site-menu .has-children .dropdown > li { list-style: none; padding: 0; margin: 0; min-width: 200px; } .site-navbar .site-navigation .site-menu .has-children .dropdown > li > a { padding: 9px 20px; display: block; } .site-navbar .site-navigation .site-menu .has-children .dropdown > li > a:hover { background: #fafafb; } .site-navbar .site-navigation .site-menu .has-children .dropdown > li.has-children > a { position: relative; } .site-navbar .site-navigation .site-menu .has-children .dropdown > li.has-children > a:after { position: absolute; right: 0; content: "\e315"; right: 20px; font-family: "icomoon"; } .site-navbar .site-navigation .site-menu .has-children .dropdown > li.has-children > .dropdown, .site-navbar .site-navigation .site-menu .has-children .dropdown > li.has-children > ul { left: 100%; top: 0; } .site-navbar .site-navigation .site-menu .has-children .dropdown > li.has-children:hover > a, .site-navbar .site-navigation .site-menu .has-children .dropdown > li.has-children:active > a, .site-navbar .site-navigation .site-menu .has-children .dropdown > li.has-children:focus > a { background: #fafafb; } .site-navbar .site-navigation .site-menu .has-children:hover > a, .site-navbar .site-navigation .site-menu .has-children:focus > a, .site-navbar .site-navigation .site-menu .has-children:active > a { color: #007bff; } .site-navbar .site-navigation .site-menu .has-children:hover > a span, .site-navbar .site-navigation .site-menu .has-children:focus > a span, .site-navbar .site-navigation .site-menu .has-children:active > a span { background: #007bff; color: #fff; } .site-navbar .site-navigation .site-menu .has-children:hover, .site-navbar .site-navigation .site-menu .has-children:focus, .site-navbar .site-navigation .site-menu .has-children:active { cursor: pointer; } .site-navbar .site-navigation .site-menu .has-children:hover > .dropdown, .site-navbar .site-navigation .site-menu .has-children:focus > .dropdown, .site-navbar .site-navigation .site-menu .has-children:active > .dropdown { -webkit-transition-delay: 0s; -o-transition-delay: 0s; transition-delay: 0s; margin-top: 0px; visibility: visible; opacity: 1; } .site-mobile-menu { width: 300px; position: fixed; right: 0; z-index: 2000; padding-top: 20px; background: #fff; height: calc(100vh); -webkit-transform: translateX(110%); -ms-transform: translateX(110%); transform: translateX(110%); -webkit-box-shadow: -10px 0 20px -10px rgba(0, 0, 0, 0.1); box-shadow: -10px 0 20px -10px rgba(0, 0, 0, 0.1); -webkit-transition: 0.3s all ease-in-out; -o-transition: 0.3s all ease-in-out; transition: 0.3s all ease-in-out; } .offcanvas-menu .site-mobile-menu { -webkit-transform: translateX(0%); -ms-transform: translateX(0%); transform: translateX(0%); } .site-mobile-menu .site-mobile-menu-header { width: 100%; float: left; padding-left: 20px; padding-right: 20px; } .site-mobile-menu .site-mobile-menu-header .site-mobile-menu-close { float: right; margin-top: 8px; } .site-mobile-menu .site-mobile-menu-header .site-mobile-menu-close span { font-size: 30px; display: inline-block; padding-left: 10px; padding-right: 0px; line-height: 1; cursor: pointer; -webkit-transition: 0.3s all ease; -o-transition: 0.3s all ease; transition: 0.3s all ease; } .site-mobile-menu .site-mobile-menu-header .site-mobile-menu-close span:hover { color: #f8f9fa; } .site-mobile-menu .site-mobile-menu-header .site-mobile-menu-logo { float: left; margin-top: 10px; margin-left: 0px; } .site-mobile-menu .site-mobile-menu-header .site-mobile-menu-logo a { display: inline-block; text-transform: uppercase; } .site-mobile-menu .site-mobile-menu-header .site-mobile-menu-logo a img { max-width: 70px; } .site-mobile-menu .site-mobile-menu-header .site-mobile-menu-logo a:hover { text-decoration: none; } .site-mobile-menu .site-mobile-menu-body { overflow-y: scroll; -webkit-overflow-scrolling: touch; position: relative; padding: 0 20px 20px 20px; height: calc(100vh - 52px); padding-bottom: 150px; } .site-mobile-menu .site-nav-wrap { padding: 0; margin: 0; list-style: none; position: relative; } .site-mobile-menu .site-nav-wrap a { padding: 10px 20px; display: block; position: relative; color: #212529; } .site-mobile-menu .site-nav-wrap a:hover { color: #007bff; } .site-mobile-menu .site-nav-wrap li { position: relative; display: block; } .site-mobile-menu .site-nav-wrap li.active > a { color: #007bff; } .site-mobile-menu .site-nav-wrap .arrow-collapse { position: absolute; right: 0px; top: 10px; z-index: 20; width: 36px; height: 36px; text-align: center; cursor: pointer; border-radius: 50%; } .site-mobile-menu .site-nav-wrap .arrow-collapse:hover { background: #f8f9fa; } .site-mobile-menu .site-nav-wrap .arrow-collapse:before { font-size: 12px; z-index: 20; font-family: "icomoon"; content: "\f078"; position: absolute; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%) rotate(-180deg); -ms-transform: translate(-50%, -50%) rotate(-180deg); transform: translate(-50%, -50%) rotate(-180deg); -webkit-transition: 0.3s all ease; -o-transition: 0.3s all ease; transition: 0.3s all ease; } .site-mobile-menu .site-nav-wrap .arrow-collapse.collapsed:before { -webkit-transform: translate(-50%, -50%); -ms-transform: translate(-50%, -50%); transform: translate(-50%, -50%); } .site-mobile-menu .site-nav-wrap > li { display: block; position: relative; float: left; width: 100%; } .site-mobile-menu .site-nav-wrap > li > a { padding-left: 20px; font-size: 20px; } .site-mobile-menu .site-nav-wrap > li > ul { padding: 0; margin: 0; list-style: none; } .site-mobile-menu .site-nav-wrap > li > ul > li { display: block; } .site-mobile-menu .site-nav-wrap > li > ul > li > a { padding-left: 40px; font-size: 16px; } .site-mobile-menu .site-nav-wrap > li > ul > li > ul { padding: 0; margin: 0; } .site-mobile-menu .site-nav-wrap > li > ul > li > ul > li { display: block; } .site-mobile-menu .site-nav-wrap > li > ul > li > ul > li > a { font-size: 16px; padding-left: 60px; } .site-mobile-menu .site-nav-wrap[data-class="social"] { float: left; width: 100%; margin-top: 30px; padding-bottom: 5em; } .site-mobile-menu .site-nav-wrap[data-class="social"] > li { width: auto; } .site-mobile-menu .site-nav-wrap[data-class="social"] > li:first-child a { padding-left: 15px !important; }
$(function() { var siteSticky = function() { $(".js-sticky-header").sticky({topSpacing:0}); }; siteSticky(); var siteMenuClone = function() { $('.js-clone-nav').each(function() { var $this = $(this); $this.clone().attr('class', 'site-nav-wrap').appendTo('.site-mobile-menu-body'); }); setTimeout(function() { var counter = 0; $('.site-mobile-menu .has-children').each(function(){ var $this = $(this); $this.prepend('<span class="arrow-collapse collapsed">'); $this.find('.arrow-collapse').attr({ 'data-toggle' : 'collapse', 'data-target' : '#collapseItem' + counter, }); $this.find('> ul').attr({ 'class' : 'collapse', 'id' : 'collapseItem' + counter, }); counter++; }); }, 1000); $('body').on('click', '.arrow-collapse', function(e) { var $this = $(this); if ( $this.closest('li').find('.collapse').hasClass('show') ) { $this.removeClass('active'); } else { $this.addClass('active'); } e.preventDefault(); }); $(window).resize(function() { var $this = $(this), w = $this.width(); if ( w > 768 ) { if ( $('body').hasClass('offcanvas-menu') ) { $('body').removeClass('offcanvas-menu'); } } }) $('body').on('click', '.js-menu-toggle', function(e) { var $this = $(this); e.preventDefault(); if ( $('body').hasClass('offcanvas-menu') ) { $('body').removeClass('offcanvas-menu'); $this.removeClass('active'); } else { $('body').addClass('offcanvas-menu'); $this.addClass('active'); } }) // click outisde offcanvas $(document).mouseup(function(e) { var container = $(".site-mobile-menu"); if (!container.is(e.target) && container.has(e.target).length === 0) { if ( $('body').hasClass('offcanvas-menu') ) { $('body').removeClass('offcanvas-menu'); } } }); }; siteMenuClone(); });

Related: See More


Questions / Comments: