It's very strange. The mega menu works on most pages, for example: https://webhost.pro/support/
But once you load the cart pages or the client area pages, the menu stops working:
https://webhost.pro/cart.php?a=view
I just added the new mega menu code, it was working fine before this new mega menu was added today. Something I added is causing a conflict with certain parts of the website. I've tried to find any error codes or messages but there is none. I checked chrome's code errors and it didn't list any related to this.
The CSS code is pretty simple:
/* Dropdown content (hidden by default) */
.dropdown-content {
position: absolute;
background-color: #f9f9f9;
width: 100%;
padding:20px 0px 20px 0px;
z-index: 15;
}
.menu{background:#FFF;padding:35px 0;font-family:'Source Sans Pro',sans-serif}.menu .navbar-brand{padding:0}.menu .logo:hover{opacity:.5;transition:opacity .55s ease-in-out;-moz-transition:opacity .55s ease-in-out;-webkit-transition:opacity .55s ease-in-out}
.menu .navbar-nav .dropdown-menu{background:#FFF;margin-top:26px;border-radius:0;padding:0;border:1px solid #dedada;border-top:none}.menu .dropdown-item{color:#013d57;font-weight:600;font-size:12px;padding:10px 30px 10px 15px;text-transform:uppercase}
The menu code is:
<!--Begin Menu-->
<div class="menu sticky-menu bridge">
<div class="container">
<nav class="navbar navbar-expand-lg navbar-light"> <a class="navbar-brand" href="{$systemurl}"><img src="{$WEB_ROOT}/templates/{$child_template}/assets/img/logo.png" alt="web host pro" width="286" height="35" class="img-fluid logo" srcset="{$WEB_ROOT}/templates/{$child_template}/assets/img-retina/logo#2x.png 2x"></a>
<button class="navbar-toggler custom-toggle" type="button" data-toggle="collapse" data-target="#main-menu" aria-controls="main-menu" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button>
<div class="collapse navbar-collapse" id="main-menu">
<ul class="navbar-nav ml-auto">
<!--Begin Main Menu Item-->
<li class="nav-item{if $filename eq 'contact' or $filename eq 'submitticket'} active{/if}"> <a class="nav-link" href="/index.php">Home</a></li>
<!--End Main Menu Item-->
<!--Begin Main Menu Item-->
</li><li class="nav-item .dropdown{if $category eq 'hosting'} active{/if}"> <a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Services<i class="fas fa-fw fa-caret-down icon-dropdown"></i></a>
<ul class="dropdown-menu dropdown-content">
<div class="row">
<div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
<li><a class="dropdown-item" href="{$WEB_ROOT}/services/website-builder/"><i class="fas fa-fw fa-server"style="color:#585453"></i>Website Builder</a></li>
<li><a class="dropdown-item" href="{$WEB_ROOT}/services/web-hosting/"><i class="fas fa-fw fa-server"style="color:#585453"></i>CPanel Web Hosting</a></li>
<li><a class="dropdown-item" href="{$WEB_ROOT}/services/reseller-hosting/"><i class="fas fa-fw fa-users"style="color:#585453"></i>Reseller Hosting</a></li>
<li><a class="dropdown-item" href="{$WEB_ROOT}/services/vps-hosting/"><i class="fas fa-fw fa-tachometer-alt"style="color:#585453"></i>VPS Hosting</a></li>
<li><a class="dropdown-item" href="{$WEB_ROOT}/services/dedicated-servers/"><i class="fas fa-fw fa-tachometer-alt"style="color:#585453"></i>Dedicated Servers</a></li>
<li><a class="dropdown-item" href="{$WEB_ROOT}/domainchecker.php"><i class="fas fa-fw fa-globe"style="color:#585453"></i>Register a domain name</a></li>
<li><a class="dropdown-item" href="{$WEB_ROOT}/cart.php?a=add&domain=transfer"><i class="fas fa-fw fa-globe"style="color:#585453"></i>Transfer a domain name</a></li>
<li><a class="dropdown-item" href="https://webhost.pro/services/ssl-certificates/"><i class="fas fa-fw fa-lock"style="color:#585453"></i>SSL certificates</a></li></div>
<div class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
<section class="heromenu img-fluid"></div></ul></li>
<!--End Main Menu Item-->
<!--Begin Main Menu Item-->
<li class="nav-item .dropdown{if $category eq 'services'} active{/if}"> <a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Support<i class="fas fa-fw fa-caret-down icon-dropdown"></i></a>
<ul class="dropdown-menu dropdown-content">
<div class="row">
<div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
<li><a class="dropdown-item" href="{$WEB_ROOT}/support/"><i class="fas fa-fw fa-life-ring"style="color:#000"></i><strong>Quick Help</strong></a></li>
<li><a class="dropdown-item" href="{$WEB_ROOT}/knowledgebase.php"><i class="fas fa-fw fa-book"style="color:#585453"></i>Knowledgebase</a></li>
<li><a class="dropdown-item" href="{$WEB_ROOT}/submitticket.php"><i class="fas fa-fw fa-life-ring"style="color:#585453"></i>New Support Ticket</a></li>
<li><a class="dropdown-item" href="{$WEB_ROOT}/supporttickets.php"><i class="fas fa-fw fa-life-ring"style="color:#585453"></i>View Support Tickets</a></li>
<li><a class="dropdown-item" href="{$WEB_ROOT}/support/payment-options/"><i class="fas fa-fw fa-credit-card"style="color:#585453"></i>Payment Options</a></li>
<li><a class="dropdown-item" href="{$WEB_ROOT}/support/how-to-build-a-website/"><i class="fas fa-fw fa-cogs"style="color:#585453"></i>Building a Website</a></li>
<li><a class="dropdown-item" href="{$WEB_ROOT}/support/starting-a-website/"><i class="fas fa-fw fa-lightbulb"style="color:#585453"></i>Website Basics</a></li></div>
<div class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
<section class="heromenu2 img-fluid">
</div></ul></li>
<li class="nav-item .dropdown{if $category eq 'services'} active{/if}"><a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Company<i class="fas fa-fw fa-caret-down icon-dropdown"></i></a>
<ul class="dropdown-menu dropdown-content">
<div class="row">
<div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
<li><a class="dropdown-item" href="{$WEB_ROOT}/company/why-us/"><i class="fas fa-fw fa-question-circle"style="color:#585453"></i>Why us</a></li>
<li><a class="dropdown-item" href="{$WEB_ROOT}/company/about-us/"><i class="fas fa-fw fa-building"style="color:#585453"></i>About us</a></li>
<li><a class="dropdown-item" href="{$WEB_ROOT}/company/affiliates/"><i class="fas fa-fw fa-sack-dollar"style="color:#119203"></i>Affiliate program</a></li>
<li><a class="dropdown-item" href="{$WEB_ROOT}/contact.php"><i class="fas fa-fw fa-comments-alt"style="color:#585453"></i>Contacts</a></li>
<li><a class="dropdown-item" href="https://blog.webhost.pro/"><i class="fas fa-fw fa-pen"style="color:#585453"></i>Our Blog</a></li>
</div>
<div class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
<section class="heromenu3 img-fluid">
</div>
</ul>
</li>
<!--End Main Menu Item-->
<!--Begin Main Menu Item-->
{if $whmcs_menu eq 'integrated'}
<li class="nav-item .dropdown{if $pagetype neq 'custom' and $filename neq 'index' and $filename neq 'contact' and $filename neq 'submitticket'} active{/if}"> <a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Clients<i class="fas fa-fw fa-caret-down icon-dropdown"></i></a>
<ul class="dropdown-menu dropdown-content">
<div class="row">
<div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
{include file="$child_template/{$zumada_content}/includes/client-navigation.tpl"}
</div>
<div class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
<section class="heromenu4 img-fluid">
</div>
</ul>
</li>
{else}
<li class="nav-item .dropdown{if $pagetype neq 'custom' and $filename neq 'index' and $filename neq 'contact' and $filename neq 'submitticket'} active{/if}"> <a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Clients<i class="fas fa-fw fa-caret-down icon-dropdown"></i></a>
<ul class="dropdown-menu dropdown-content">
{if $loggedin}
<li><a class="dropdown-item" href="{$WEB_ROOT}/clientarea.php"><i class="fas fa-user fa-fw"></i>{$LANG.account}</a></li>
<li><a class="dropdown-item" href="{$WEB_ROOT}/logout.php"><i class="fas fa-sign-out-alt fa-fw"></i>{$LANG.clientareanavlogout}</a></li>
{else}
<li><a class="dropdown-item" href="{$WEB_ROOT}/clientarea.php"><i class="fas fa-lock fa-fw"style="color:#119203"></i>{$LANG.login}</a></li>
{if $condlinks.allowClientRegistration eq 'on'}
<li><a class="dropdown-item" href="{$WEB_ROOT}/register.php"><i class="fas fa-users fa-fw"></i>{$LANG.register}</a></li>
{/if}
<li><a class="dropdown-item" href="{$WEB_ROOT}/pwreset.php"><i class="fas fa-key fa-fw"></i>{$LANG.forgotpw}</a></li>
{/if}
</ul>
</li>
{/if}
<!--End Main Menu Item-->
<!--Begin Main Menu Item--> <!--End Main Menu Item-->
<!--Begin Cart Link-->
<li class="nav-item cart"><a href="{$WEB_ROOT}/cart.php?a=view"><span class="mobile-menu">View Cart</span><span class="cart-count"><i class="fas fa-shopping-cart"></i>
<span class="btn btn-headercart">{$cartitemcount}</span>
</span></a></li>
<!--End Cart Link-->
</ul>
</div>
</nav>
</div>
</div>
<!--End Menu-->
It was a conflict in the file:bridge.min.css
I removed the code from this CSS file and it's all good!
.bridge .dropdown,.bridge .dropleft,.bridge .dropright,.bridge .dropup{position:relative}.bridge .dropdown-toggle{white-space:nowrap}.bridge .dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid;border-right:.3em solid transparent;border-bottom:0;border-left:.3em solid transparent}.bridge .dropdown-toggle:empty::after{margin-left:0}.bridge .dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:10rem;padding:.5rem 0;margin:.125rem 0 0;font-size:1rem;color:#212529;text-align:left;list-style:none;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.15);border-radius:.25rem}.bridge .dropdown-menu-left{right:auto;left:0}.bridge .dropdown-menu-right{right:0;left:auto}#media (min-width:576px){.bridge .dropdown-menu-sm-left{right:auto;left:0}.bridge .dropdown-menu-sm-right{right:0;left:auto}}#media (min-width:768px){.bridge .dropdown-menu-md-left{right:auto;left:0}.bridge .dropdown-menu-md-right{right:0;left:auto}}#media (min-width:992px){.bridge .dropdown-menu-lg-left{right:auto;left:0}.bridge .dropdown-menu-lg-right{right:0;left:auto}}#media (min-width:1200px){.bridge .dropdown-menu-xl-left{right:auto;left:0}.bridge .dropdown-menu-xl-right{right:0;left:auto}}
Related
I want to have my navigation bar stuck to the top of the screen, but then the dropdown button does not work correctly. But if I remove fixed-top the dropdown works, but its no longer stuck to the top of the screen.
Also I am trying to put a blank line between the HOME and Account in the dropdown and cant figure out how to do that with out breaking the dropdown.
<nav class="navbar navbar-expand-sm fixed-top">
<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>
<a class="navbar-brand" href="/testing/"><img class="img-responsive" src="/testing/users/images/logo.png"></a>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav navbar-right links">
<li class="nav-item"><span class="fa fa-fw fa-home"></span> Home</li>
<li class="nav-item"><span class="fa fa-fw fa-user"></span> admin</li>
<li><i class="fa fa-envelope"></i> <span id="msgCount" class="badge" style="margin-top: -5px"></span></li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" id="dropdown_main" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span class="fa fa-fw fa-cogs"></span> <span class="caret"></span></a>
<div class="dropdown-menu dropdown-info" aria-labelledby="dropdown_main">
<a class="dropdown-item" href="/testing/"><span class="fa fa-fw fa-home"></span> Home</a>
<a class="dropdown-item" href="/testing/users/account.php"><span class="fa fa-fw fa-user"></span> Account</a>
<a class="dropdown-item" href="/testing/users/admin.php"><span class="fa fa-fw fa-cogs"></span> Admin Dashboard</a>
<a class="dropdown-item" href="/testing/users/admin.php?view=users"><span class="fa fa-fw fa-user"></span> User Management</a>
<a class="dropdown-item" href="/testing/users/admin.php?view=permissions"><span class="fa fa-fw fa-lock"></span> Permissions Management</a>
<a class="dropdown-item" href="/testing/users/admin.php?view=pages"><span class="fa fa-fw fa-wrench"></span> Page Management</a>
<a class="dropdown-item" href="/testing/users/admin.php?view=messages"><span class="fa fa-fw fa-envelope"></span> Messages Manager</a>
<a class="dropdown-item" href="/testing/users/admin.php?view=logs"><span class="fa fa-fw fa-search"></span> System Logs</a>
<a class="dropdown-item" href="/testing/users/logout.php"><span class="fa fa-fw fa-sign-out"></span> Logout</a>
</div>
</li>
</ul>
</div>
<ul class="navbar-nav navbar-right">
<li class="nav-item dropdown hidden">
<a class="nav-link dropdown-toggle" id="navbarDropdownMenuHidden" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Menu</a>
<div class="dropdown-menu dropdown-info hidden-links" aria-labelledby="navbarDropdownMenuHidden">
</div>
</li>
</ul>
To make a divider in your drop-down menu you can use <div class="dropdown-divider"></div> and to align your ul to right you can use bootstrap class ml-auto Ijnstead of fixed-top you can use sticky-top as your navbar will be sticky through out your page scroll
.dropdown-divider {
border-top: 1px solid red!important;
}
li.nav-item {
padding: 0px 15px
}
#media only screen and (min-width: 767px) {
ul.navbar-nav {
padding: 0px 60px
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
</head>
<body>
<nav class="navbar navbar-expand-lg bg-dark navbar-dark sticky-top">
<a class="navbar-brand" href="#"><img class="img-responsive" src="/testing/users/images/logo.png"></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="collapsibleNavbar">
<ul class="navbar-nav ml-auto">
<li class="nav-item"><span class="fa fa-fw fa-home"></span> Home</li>
<li class="nav-item"><a href="/testing/users/account.php" class="nav-link"><span
class="fa fa-fw fa-user"></span> admin</a></li>
<li class="nav-item">
<a href="/testing/users/messages.php" class="nav-link">
<span class="fa fa-envelope"></span><i class="badge"></i> Message</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="dropdown_main" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span class="fa fa-fw fa-cogs"></span> <span class="caret"></span>Settings</a>
<div class="dropdown-menu dropdown-info" aria-labelledby="dropdown_main">
<a class="dropdown-item" href="/testing/"><span class="fa fa-fw fa-home"></span> Home</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="/testing/users/account.php"><span class="fa fa-fw fa-user"></span>
Account</a>
<a class="dropdown-item" href="/testing/users/admin.php"><span class="fa fa-fw fa-cogs"></span> Admin
Dashboard</a>
<a class="dropdown-item" href="/testing/users/admin.php?view=users"><span class="fa fa-fw fa-user"></span>
User Management</a>
<a class="dropdown-item" href="/testing/users/admin.php?view=permissions"><span
class="fa fa-fw fa-lock"></span> Permissions Management</a>
<a class="dropdown-item" href="/testing/users/admin.php?view=pages"><span class="fa fa-fw fa-wrench"></span>
Page Management</a>
<a class="dropdown-item" href="/testing/users/admin.php?view=messages"><span
class="fa fa-fw fa-envelope"></span> Messages Manager</a>
<a class="dropdown-item" href="/testing/users/admin.php?view=logs"><span class="fa fa-fw fa-search"></span>
System Logs</a>
<a class="dropdown-item" href="/testing/users/logout.php"><span class="fa fa-fw fa-sign-out"></span>
Logout</a>
</div>
</li>
<li class="nav-item dropdown menu">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span
class="fa fa-fw fa-lock"></span> menu
</a>
<div class="dropdown-menu w-100" aria-labelledby="navbarDropdown">
<a class="dropdown-item mx-auto" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<a class="dropdown-item" href="#">Another action</a>
<a class="dropdown-item" href="#">Another action</a>
</div>
</li>
</ul>
</div>
</nav>
</body>
</html>
i am creating a navbar in bootstrap and the issue is that when i resize my browser it shows navigation toggle button and if the page is inspected in chrome or opera navigation toggle button is not shown and full menu is displayed.
i uploaded the site on a domain and looked it from a phone but there was no toggle button and simply complete nav menu.
my issue's screenshots link is http://zian.tk/pictures/Capture01.jpg
HTML for the code is:
<nav class="nav navbar navbar-expand-md bg-dark navbar-dark">
<div class="row w-100">
<div class="col-lg-2">
<h1`enter code here` class="text-white text-center">
LOGO
</h1>
</div>
<button class="navbar-toggler w-100" 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="col-lg-8">
<div class="collapse navbar-collapse text-center mx-auto justify-content-center" id="navbarSupportedContent">
<ul class="navbar-nav text-centre mt-2" >
<li class="nav-item dropdown pr-4">
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Something else here</a>
</div>
home
</li>
<li class="nav-item pr-4">
about
</li>
<li class="nav-item pr-4">
blog
</li>
<li class="nav-item pr-4">
Insights
</li>
<li class="nav-item pr-4">
contact
</li>
<li class="nav-item">
Services
</li>
</ul>
</div>
</div>
<div class="col-lg-2 col-md-12 pt-3 float-right justify-content-end ">
<div class="text-center">
<i class="fab fa-twitter"></i>
<i class="fab fa-facebook pr-2 mb-0"></i>
<i class="fab fa-instagram pr-2 mb-0"></i>
<i class="fab fa-behance pr-2 mb-0"></i>
<i class="fab fa-google pr-2 mb-0"></i>
<i class="fab fa-pinterest"></i>
</div>
</div>
</div>
</nav>
Is there a way to achieve the following result with Bootstrap 4 (with centered menu items in second row):
This was made with Bootstrap 3 but I cant get it to work with Bootstrap 4 (the right navbar (Upgrade, govel, ...) does not float, instead a scroll bar is added when there is not enough space).
My Bootstrap 4 code:
https://www.bootply.com/awN10dN1Ns
Any tips how to get the menu items float to a second row like on the screenshot above if there is not enough space for a one-line nav? How to center the menu items in the second row?
Link to Bootstrap 3 example is: https://www.lotsearch.de/
Please try below css.
#navbarSupportedContent {
text-align: center;
display: block !important;
}
#navbarSupportedContent ul.navbar-nav {
display: block !important;
}
#navbarSupportedContent ul.navbar-nav li {
display: inline-block;
}
Wrap the 2 rows in separate d-flex divs, and use w-100 to make them fill the width of the navbar. The use flex-column in the navbar to make the 2 divs stack vertically.
<nav class="navbar navbar-expand-md navbar-light flex-column" id="header">
<div class="w-100 d-flex">
<a href="/" class="navbar-brand">
<img src="/images/favicons/favicon_144x144.png" class="favicon-logo" alt="Logo">
</a>
<ul class="navbar-nav navbar-expand px-3 order-last">
<li class="nav-item">
<a class="nav-link text-nowrap nav-small-link" href="" title="Vorgemerkte Gebote auf Ihrer Bietliste">
<div class="icon-wrapper">
<i class="fa fa-gavel fa-fw"></i>
<span class="badge badge-orange" id="bidlist-counter">0</span>
</div>
</a>
</li>
<li class="nav-item">
<a class="nav-link text-nowrap nav-small-link" href="" title="Merkzettel">
<div class="icon-wrapper">
<i class="fa fa-bookmark fa-fw"></i>
<span class="badge badge-orange" id="bookmark-counter">14</span>
</div>
</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link text-nowrap dropdown-toggle" href="#" id="navbarDropdownLanguage" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="flag-icon flag-icon-de"></span>
</a>
<div class="dropdown-menu dropdown-langauge dropdown-menu-right" aria-labelledby="navbarDropdownLanguage">
<a class="dropdown-item text-nowrap" href="" hreflang="en">
<span class="flag-icon flag-icon-gb"></span> GB </a>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle text-nowrap" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-user fa-fw"></i>
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="/user">
<i class="fa fa-user fa-fw"></i> Mein Account </a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="/bids/management/bidlist">
<i class="fa fa-user fa-fw"></i> Bietliste <span class="badge badge-orange" id="bidlist-counter">0</span>
</a>
<a class="dropdown-item" href="/bids/management/manual-bidlist">
<i class="fa fa-user fa-fw"></i> PDF-Gebote </a>
<a class="dropdown-item" href="/bids/management/placed-bidlist">
<i class="fa fa-user fa-fw"></i> Abgegebene Gebote </a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="/static/contact">
<i class="fa fa-envelope fa-fw"></i> Kontakt aufnehmen </a>
<a class="dropdown-item" href="/static/faq">
<i class="fa fa-graduation-cap fa-fw"></i> FAQ </a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="/user/logout">
<i class="fa fa-sign-out fa-fw"></i> Logout </a>
</div>
</li>
</ul>
<button class="navbar-toggler order-last" 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>
<ul class="navbar-nav ml-auto">
<li>
<a class="nav-link text-nowrap orange" href="">
<i class="fa fa-arrow-circle-up"></i> Upgrade </a>
</li>
</ul>
</div>
<div class="navbar-collapse collapse w-100 justify-content-md-center justify-content-start" id="navbarSupportedContent">
<ul class="navbar-nav">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle text-nowrap" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-fw fa-search"></i> Suche <span class="caret"></span>
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="/">
<i class="fa fa-lightbulb-o fa-fw"></i> Suche (Aktuelle Auktionen) </a>
<a class="dropdown-item" href="/archive">
<i class="fa fa-archive fa-fw"></i> Suche (Archiv) </a>
</div>
</li>
<li class="nav-item">
<a class="nav-link text-nowrap" href="/auction-catalogues">
<i class="fa fa-book fa-fw"></i> Kataloge </a>
</li>
<li class="nav-item">
<a class="nav-link text-nowrap" href="/category"><i class="fa fa-list-alt fa-fw"></i> Kategorien </a>
</li>
<li class="nav-item">
<a class="nav-link text-nowrap" href="/alert"><i class="fa fa-bell fa-fw"></i> Suchaufträge </a>
</li>
<li class="nav-item">
<a class="nav-link text-nowrap" href="/artist"><i class="fa fa-bar-chart fa-fw"></i> Künstler / Analysen </a>
</li>
<li class="nav-item">
<a class="nav-link text-nowrap" href="/blog"><i class="fa fa-newspaper-o fa-fw"></i> Blog </a>
</li>
</ul>
</div>
</nav>
https://www.codeply.com/go/TyYjq0u7B0
Note: The hidden-* classes don't exist in Bootstrap 4.
Also see: How can I have Brand and Navbar on separate lines?
you can change this:
#media (min-width: 768px) {
.navbar-expand-md {
-ms-flex-flow: row nowrap;
flex-flow: row nowrap;
}
}
by this:
#media (min-width: 768px) {
.navbar-expand-md {
-ms-flex-flow: row wrap;
flex-flow: row wrap;
}
}
this is what you expect?
Add this for ordering your nav:
#media (min-width: 768px) {
.navbar-expand-md .navbar-nav{
order:0
}
}
I want to have the header bar with three elements like below
But in mobile view i want menu(toggle-icon) to go left and logo should come middle. I tried push and pull. but that doesn't work for me. Is there anyway i can achieve this?
Here is my code. FYI, I did not add any separate media query yet. Just using the bootstrap classes.
<div class="row d-flex flex-nowrap" style="background-color: #2B3536;">
<div class="col-lg-1 col-md-1 col-sm-2 col-2 align-self-center"><img src="https://dummyimage.com/127x50/2b3536/fff"></div>
<div class="col-lg-8 col-md-9 col-sm-8 col-8 order-sm-first">
<nav class="navbar navbar-fixed-top navbar-toggleable-sm navbar-expand-sm">
<div class="container d-flex flex-row flex-md-nowrap flex-wrap">
<a href="#" class="hidden-md-up mr-3" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false">
<i class="fa fa-bars fa-lg text-white"></i>
</a>
<!--<button class="navbar-toggler navbar-toggler-right" 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 header-nav">
<li class="nav-item">
<a class="nav-link" href="#">Menu 1</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Menu 2</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Menu 3</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Menu 4</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">About Us</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Contact Us</a>
</li>
<!--<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="http://example.com" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown link
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</li>-->
</ul>
</div>
</div>
</nav>
</div>
<div class="col-lg-3 col-md-2 col-sm-2 col-2 align-self-center">
<div class="input-group">
<input class="form-control hidden-md-down"
placeholder="I'm looking for">
<div class="input-group-addon top-search-addon"><i class="fa fa-search fa-search-white"></i></div>
</div>
</div>
</div>
you should add media query to style css file
.navbar-brand{
padding-top:8px;
}
.navbar-brand img{
height:35px;
width:35px
}
#media (max-width:767px) {
.navbar-brand{
position: absolute;
left: 40%;
}
}
.navbar-toggle {
float: left;
}
you can view alive demo menu design
I'm trying to create a navbar header with a logo on the left, search box in the center, and a small menu on the right similar to Reverb's. Here:
I've gotten it pretty close but for some reason, my menu is being pushed down to a second line because my search bar is too long.
I've tried putting in the row and breaking the sections up into smaller col-sm-4 divs, but that messes things up more (FYI, I'm using Bootstrap 4).
Here is my html. Haven't done really any CSS other than change the default colors.
<header class="header">
<nav class="navbar navbar-expand-sm fixed top mb-3">
<div class="container">
<a href="#" class="navbar-brand">
NAVBAR
</a>
<div class="input-group">
<div class="input-group-btn">
<button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
By
</button>
<div class="dropdown-menu">
<a class="dropdown-item" href="#">User name</a>
<a class="dropdown-item" href="#">Member type</a>
<a class="dropdown-item" href="#">Company</a>
<a class="dropdown-item" href="#">Genre</a>
<div role="separator" class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Separated link</a>
</div>
</div>
<input type="text" class="form-control" aria-label="Text input with dropdown button" placeholder="Search for...">
<span class="input-group-btn">
<button class="btn btn-secondary" type="button">Go!</button>
</span>
</div>
<ul class="nav justify-content-end">
<li class="nav-item">
<a class="nav-link active" href="#"><i class="fa fa-envelope-o" aria-hidden="true"></i></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#"><i class="fa fa-bell-o" aria-hidden="true"></i></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#"><i class="fa fa-user" aria-hidden="true"></i></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#"><i class="fa fa-info-circle" aria-hidden="true"></i></a>
</li>
</ul>
</div>
</nav>
</header>
If your goal is to keep the icons to the right of the search from wrapping, then you could try something like this:
ul.justify-content-end {
min-width:200px;
}