Aligning nav bar / shrinking dropdown menu box - html

I've gotten the following code to look as I want it, except I need the last two nav bar items to align far right.
I can make that happen with ul {text-align: right; width: 100%; background-color: #48C2C5;}, but when I do that, it alters the size of my dropdown menus.
I've attached a few pictures along with the code.
I'm doing this in Springshare Libguides.
Nav bar without far right 2 aligned right:
Cut off dropdown menu:
<style>
.s-lib-box {border-color: none; border-width: 0; box-shadow: none; background-color: none;}
.s-lib-box .s-lib-box-title {display: none;}
.s-lib-box .s-lg-box-footer {display: none;}
body {padding-left: 0; padding-right: 0;}
#s-lib-public-main a {color: #17365D;}
#s-lib-public-main a:visited {color: #2293c0;}
/*ABC Header*/
#header-abc {background-color: #ffffff; width: auto; }
#banner-abc {height: 110px; width: 1200px; margin-left: auto; margin-right: auto;}
#logo-abc {float: left; margin-left: 12px; margin-top: 10px;}
#search-cat {margin-top: 15px; padding: 0px 0px; text-align: right;}
#translate {padding: 2px 0px;}
#google_translate_element {width: 160px; margin: 15px 0;}
/*Menu*/
.caret{solid #ffffff;}
#menu-abc .navbar .nav > li > a, .navbar .nav > li > a:first-letter,
.navbar .nav > li.current-menu-item > a,
.navbar .nav > li.current-menu-ancestor > a {
}
#menu-abc .navbar .nav > li > a, .navbar .nav > li > a:first-letter {
color: white;
text-shadow: none;
}
#menu-abc .navbar .nav > li > a:hover, .navbar .nav > li > a:hover:first-letter {
color:#006699;
text-shadow: none;
}
#menu-abc .navbar .nav > li > a:active, .navbar .nav > li > a:active:first-letter,
.navbar .nav > li.current-menu-item > a,
.navbar .nav > li.current-menu-ancestor > a,
.navbar .nav > li.current-menu-item > a:first-letter,
.navbar .nav > li.current-menu-ancestor > a:first-letter {
color:#0099CC;
text-shadow: none;
}
#menu-abc .dropdown-menu > li > a {
color: #48C2C5;
background: white;
}
.dropdown ul li {
color:#0099CC;
}
#menu-abc .dropdown ul ul li a {
font-size:14px;
color:#0099CC;
}
#menu-abc .navbar .nav > li.current-menu-item > a, .navbar .nav > li.current-menu-ancestor > a,
.navbar .nav > li > a:hover, .navbar .nav > li > a:focus {
color: #red;
}
#menu-abc {background-color: #48C2C5; border-bottom: none;box-shadow: 3px 3px 10px 1px #green;}
#menu-abc .container-fluid {padding: 20;}
#menu-abc .navbar { min-height: 15px; background-color: #48C2C5;}
#menu-abc a {padding-right: 0px; font-family: Perpetua; font-size: 18px; font-weight: bold;}
#menu-abc a:hover {color: #red;}
.dropdown:hover .dropdown-menu {font-size: 14px; display: inline; }
.dropdown-menu > li > a {
background: #48C2C5;
border-bottom: none; }
#menu-abc {background-color: #48C2C5; border-bottom: none;box-shadow: 3px 3px 10px 1px #white;}
#menu-abc .container-fluid {padding: 0;}
#menu-abc .navbar { min-height: 15px; background-color: #48C2C5;}
#menu-abc a {padding-right: 25px; font-family: Perpetua; font-size: 18px; font-weight: bold;}
#menu-abc a:hover {color: #red;}
#menu-abc .dropdown:hover .dropdown-menu {display: block;}
.dropdown-content {
min-width: 160px;}
#menu-abc .navbar-default .navbar-collapse, #menu-abc .navbar-default .navbar-form {background-color: #48C2C5;}
#menu-abc .navbar-default {width: auto; margin-left: auto; margin-right: auto; border: none;}
#menu-abc .dropdown-menu a {color:#0099CC;}
#menu-abc .dropdown-menu a:hover {background-color: #yellow;}
#menu-abc .dropdown-menu .divider {background-color: #48C2C5;}
#menu-abc .navbar-default .navbar-nav > .open > a {color: #48C2C5; background-color: #yellow;}
#menu-abc .navbar-default .navbar-nav > li.open > a {color: #yellow; background-color: #48C2C5;}
#menu-abc .navbar-nav .dropdown:hover > a[data-toggle=dropdown] + .dropdown-menu {display: block;}
#menu-abc .navbar-nav .dropdown.open > a[data-toggle=dropdown] + .dropdown-menu {display: block;}
/*Main Content Area*/
#s-lib-public-main .row {margin-bottom: 30px; margin-left: 5px;}
<title></title>
</head>
<body class="s-lg-guide-body">
<!-- BEGIN: Page Header -->
<meta content="97a72cc605382e45-5c9ddd9618eb904f-gad80e90ba61d526a-e" name="google-translate-customization">
<div id="header-abc">
<div class="container-fluid" id="banner-abc">
<div class="row">
<div class="col-sm-6 center" id="col1">
<div class="row">
<div class="col-md-6" id="logo-abc">
<img height="100" src="https://libapps.s3.amazonaws.com/accounts/27400/images/bunche_new_logo.jpg">
</div><!--/logo-abc=-->
</div><!--/row-->
</div><!--/col1-->
<div class="col-sm-6" id="col0">
<div class="row">
<div class="col-md-7" id="search-cat">
<br>
</div><!--/row-->
</div><!--/col2-->
</div>
</div><!--/banner-abc-->
</div><!-- Menu -->
<div id="menu-abc">
<nav class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button class="navbar-toggle" data-target="#abc-navbar-collapse-1" data-toggle="collapse" type="button"><span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span></button>
</div><!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="abc-navbar-collapse-1">
<ul class="nav navbar-nav">
<li>
My Account
</li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Find<span class="caret"></span></a>
<ul class="dropdown-menu">
<li>
Catalog
</li>
<li>
Library Map
</li>
<li class='sub'>
Databases
<ul>
<li>
Current Trials
</li>
</ul>
<ul>
<li>
Direct Access Resources
</li>
</ul>
</li>
<li>
Find a Journal
</li>
<li>
Ebooks
</li>
<li>
Virtual Periodical Reading Room
</li>
</ul>
</li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Get Help<span class="caret"></span></a>
<ul class="dropdown-menu">
<li>
Research & Instruction Services
</li>
<li>
Ebook Virtual Library
</li>
<li>
Virtual Libraries
</li>
<li>
A - Z Journal List
</li>
<li>
Bibliographies
<ul>
<li>
Foreign Affairs Professional Reading List
</li>
</ul>
</li>
<li>
<a>Briefing Videos</a>
</li>
<li>
Copyright
</li>
</ul>
</li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Library Services<span class="caret"></span></a>
<ul class="dropdown-menu">
<li>
My Library Account
<ul>
<li>
How to Create an Account
</li>
</ul>
</li>
<li>
Acquisitions and Procurement
<ul>
<li>
DS-2092
</li>
</ul>
</li>
<li>
Interlibrary Loan
</li>
<li>
Map Services
</li>
<li>
Instruction
</li>
<li>
Donations
</li>
<li>
Booking the Rare Book Room
</li>
</ul>
</li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">About Us<span class="caret"></span></a>
<ul class="dropdown-menu">
<li>
Mission and Vision
</li>
<li>
Library Staff
</li>
<li>
Policies
<ul>
<li>
Circulation
</li>
</ul>
<ul>
<li>
Collection Development
</li>
</ul>
</li>
<li>
Who was Ralph Bunche?
</li>
<li>
Rare Book Collection
</li>
<li>
5 FAM 1400
</li>
<li class="divider"></li>
<li>
Office of Information Programs and Services
</li>
</ul>
</li>
<li style="float:right;">
<a href="#</a>
</li>
<li style="float:right;">
A/GIS/IPS
</li>
</ul><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</div>
</nav>
</div><!-- END: Page Header Without Encore -->
<!-- END: Page Header -->
</div>
</body>
</html>

I know LibGuides use Bootstrap 3, so instead of the float right on the last two list items, I've placed a pull-right class. I also set the UL element to stretch to 100%. The answer below only includes the HTML, not the CSS, but give it a try:
<div id="header-abc">
<div class="container-fluid" id="banner-abc">
<div class="row">
<div class="col-sm-6 center" id="col1">
<div class="row">
<div class="col-md-6" id="logo-abc">
<img height="100" src="https://libapps.s3.amazonaws.com/accounts/27400/images/bunche_new_logo.jpg">
</div><!--/logo-abc=-->
</div><!--/row-->
</div><!--/col1-->
<div class="col-sm-6" id="col0">
<div class="row">
<div class="col-md-7" id="search-cat">
<br>
</div><!--/row-->
</div><!--/col2-->
</div>
</div><!--/banner-abc-->
</div><!-- Menu -->
<div id="menu-abc">
<nav class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button class="navbar-toggle" data-target="#abc-navbar-collapse-1" data-toggle="collapse" type="button"><span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span></button>
</div><!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="abc-navbar-collapse-1">
<ul class="nav navbar-nav" style="width:100%;">
<li>
My Account
</li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Find<span class="caret"></span></a>
<ul class="dropdown-menu">
<li>
Catalog
</li>
<li>
Library Map
</li>
<li class='sub'>
Databases
<ul>
<li>
Current Trials
</li>
</ul>
<ul>
<li>
Direct Access Resources
</li>
</ul>
</li>
<li>
Find a Journal
</li>
<li>
Ebooks
</li>
<li>
Virtual Periodical Reading Room
</li>
</ul>
</li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Get Help<span class="caret"></span></a>
<ul class="dropdown-menu">
<li>
Research & Instruction Services
</li>
<li>
Ebook Virtual Library
</li>
<li>
Virtual Libraries
</li>
<li>
A - Z Journal List
</li>
<li>
Bibliographies
<ul>
<li>
Foreign Affairs Professional Reading List
</li>
</ul>
</li>
<li>
<a>Briefing Videos</a>
</li>
<li>
Copyright
</li>
</ul>
</li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Library Services<span class="caret"></span></a>
<ul class="dropdown-menu">
<li>
My Library Account
<ul>
<li>
How to Create an Account
</li>
</ul>
</li>
<li>
Acquisitions and Procurement
<ul>
<li>
DS-2092
</li>
</ul>
</li>
<li>
Interlibrary Loan
</li>
<li>
Map Services
</li>
<li>
Instruction
</li>
<li>
Donations
</li>
<li>
Booking the Rare Book Room
</li>
</ul>
</li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">About Us<span class="caret"></span></a>
<ul class="dropdown-menu">
<li>
Mission and Vision
</li>
<li>
Library Staff
</li>
<li>
Policies
<ul>
<li>
Circulation
</li>
</ul>
<ul>
<li>
Collection Development
</li>
</ul>
</li>
<li>
Who was Ralph Bunche?
</li>
<li>
Rare Book Collection
</li>
<li>
5 FAM 1400
</li>
<li class="divider"></li>
<li>
Office of Information Programs and Services
</li>
</ul>
</li>
<li class="pull-right">
Knowledge Portal
</li>
<li class="pull-right">
A/GIS/IPS
</li>
</ul><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</div>
</nav>
</div><!-- END: Page Header Without Encore -->
<!-- END: Page Header -->
</div>

You problem is with this css code:
ul {text-align: right; width: 100%; background-color: #48C2C5;}
It will affected all the same element or recursively to all it's child element.
To solved this you can add additional id or class on the affected element to make it unique:
ul.unique {text-align: right; width: 100%; background-color: #48C2C5;}
or overwrite style on unwanted affected element only:
ul li.sub-menu {text-align: left;}

Related

How to apply styles like hover, selected to this side nav menu

I have side nav menu but when i apply styles its disturbing other ul and li elements on page, I want to apply hover and selected styles to this nav, can you please share some sample how can do that for just this specific menu
<div class="col-xs-4 col-md-4 col-lg-4 navleftnavigator" >
<!-- Sidebar -->
<nav class="navbar navbar-center" id="sidebar-wrapper" role="navigation" style="border: 1px solid #862828">
<ul class="nav sidebar-nav ">
<li>
Home
</li>
<li>
About
</li>
<li>
Events
</li>
<li>
Team
</li>
<li>
Services
</li>
<li>
Contact
</li>
<li>
Follow me
</li>
</ul>
</nav>
<!-- /#sidebar-wrapper -->
</div>
Add a unique className or even an id to your nav element
And then use a unique css selector.
something like:
nav.crazy-class-name-without-duplicates {
border: 1px solid red;
}
nav.crazy-class-name-without-duplicates > ul > li {
border: 1px solid tomato;
}
nav.crazy-class-name-without-duplicates > ul > li > a {
color: navy;
}
nav.crazy-class-name-without-duplicates > ul > li:hover {
/* li mouseover */
background-color: red;
}
a::selection {
/* a selection */
background-color: yellow;
}
<div class="col-xs-4 col-md-4 col-lg-4 navleftnavigator" >
<!-- Sidebar -->
<nav class="navbar navbar-center crazy-class-name-without-duplicates" id="sidebar-wrapper" role="navigation" style="border: 1px solid #862828">
<ul class="nav sidebar-nav ">
<li>
Home
</li>
<li>
About
</li>
<li>
Events
</li>
<li>
Team
</li>
<li>
Services
</li>
<li>
Contact
</li>
<li>
Follow me
</li>
</ul>
</nav>
<!-- /#sidebar-wrapper -->
</div>

Bootstrap nav not centered

I have a Bootstrap menu that that is slightly aligned to the left for some reason, I can't debug it. It doesn't have any rows, but the container is fluid and changing this to fixed makes it unresponsive in mobiles.
This is the live example. https://codepen.io/anon/pen/qjKbQM
This is the HTML code:
<nav class="navbar navbar-default" style="border:1px solid red";>
<div class="container-fluid">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">UP</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><span class="glyphicon glyphicon-th" aria-hidden="true"></span> DEVIS GRATUIT</li>
<li class="dropdown">
Nos Ressource <span class="caret"></span>
<ul class="dropdown-menu">
<li>
Toutes nos ressources
</li>
<li>
Fiches conseils
</li>
<li>
Fiches métiers
</li>
<li>
Foire aux questions
</li>
<li>
Revue de presse
</li>
<li>
Le Blog
</li>
</ul>
</li>
<li class="dropdown">
Nos Fonctionalites <span class="caret"></span>
<ul class="dropdown-menu">
<li>
Toutes nos fonctionnalités
</li>
<li class="">
Mes indicateurs
</li>
<li class="">
Ma comptabilité
</li>
<li class="">
Mes devis et factures
</li>
<li class="">
Mon budget
</li>
<li>
Mon social-RH
</li>
<li class="">
Mon coffre-fort
</li>
</ul>
</li>
<li>Accounts</li>
<li class="dropdown">
Notre Cabinet <span class="caret"></span>
<ul class="dropdown-menu">
<li>
Tout sur notre cabinet
</li>
<li class="">
Qui sommes-nous ?
</li>
<li>
Pourquoi nous choisir ?
</li>
<li>
Comment devenir client ?
</li>
<li>
Notre équipe
</li>
<li>
Vos questions, nos réponses
</li>
<li class="">
Témoignages clients
</li>
<li class="">
Recrutement
</li>
</ul>
</li>
<li class="dropdown">
Nos Solutions <span class="caret"></span>
<ul class="dropdown-menu">
<li>
Toutes nos solutions
</li>
<li class="">
TPE / Consultants
</li>
<li>
Porteurs de projet
</li>
<li>
SCI / Locations meublées
</li>
<li class="">
Paye des salariés
</li>
<li class="">
Professions Libérales
</li>
<li class="">
Associations
</li>
<li class="">
Toutes nos solutions
</li>
</ul>
</li>
</ul>
</div><!-- /.navbar-collapse -->
</div>
</div><!-- /.container-fluid -->
</nav>
And this is the css :
.navbar-default {
font-size: 1.15em;
font-weight: 400;
border: 0px;
border-radius: 0px;
background: #021a2f !important;
}
.navbar-default .navbar-nav>li>a {
color: white;
}
.navbar-default .navbar-nav>li>a:hover {
color: #cbf0ff;
}
.navbar-default .navbar-brand {
color: #002433;
}
.navbar-default .navbar-brand:hover {
color: #ffffff;
text-shadow: 1px -1px 8px #b3e9ff;
}
.navbar-default .navbar-nav>.open>a, .navbar-default .navbar-nav>.open>a:hover, .navbar-default .navbar-nav>.open>a:focus {
background-color: #004059;
color: white;
}
.navbar-default .navbar-toggle {
border: none;
}
.navbar-default .navbar-collapse, .navbar-default .navbar-form {
border: none;
}
.navbar-default .navbar-toggle:hover, .navbar-default .navbar-toggle:focus {
background-color: #002433;
}
.navbar-default .navbar-toggle .icon-bar {
}
.dropdown-menu {
background-color: #004059;
color: white;
border: 0px;
border-radius: 2px;
padding-top: 10px;
padding-bottom: 10px;
}
.dropdown-menu>li>a {
background-color: #004059;
color: white;
}
.dropdown-menu>li>a:hover, .dropdown-menu>li>a:focus {
background-color: #004059;
color:white;
}
.dropdown-menu .divider {
height: 1px;
margin: 9px 0;
overflow: hidden;
background-color: #003246;
}
.navbar-default .navbar-nav .open .dropdown-menu>li>a {
color: #ffffff;
}
#media (max-width: 767px) {
.dropdown-menu>li>a {
background-color: #006b96;
color: #ffffff;
}
.dropdown-menu>li>a:hover {
color: #ffffff;
}
.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus, .navbar-default .navbar-nav .open .dropdown-menu>li>a:hover {
color: #ffffff;
background-color: transparent;
}
.dropdown-menu .divider {
height: 1px;
margin: 9px 0;
overflow: hidden;
background-color: #005577;
}
}
How can I make the menus be centered without loosing the responsiveness of the navbar?
Add below css to get
.nav.customCl {
display: flex;
justify-content: center;
align-items: center;
flex-flow: row wrap;
}
And use this class in following html
<ul class="nav navbar-nav customCl"
codepen link

Navbar dropdown link left aligned in mobile app version

My navbar link "Services" is left aligned as compared to the other links. I want to align it with the rest.
I have tried Bootstrap NavBar not aligned, especially in mobile view but it doesn't help me in my scenario.
Please advise where am i going wrong.
Navbar
CSS:
/* Dropdown Button */
.dropbtn {
background-color: #4CAF50;
color: white;
padding: 16px;
font-size: 10px;
border: none;
cursor: pointer;
}
/* The container <div> - needed to position the dropdown content */
.dropdown {
padding: 13px 0px 10px 0px;
display; inline;
display: inline-block;
}
.dropdown:hover{
background-color:#37979f;
border:1px solid;
border-color: #fff;
border-radius:4px;
}
/* Dropdown Content (Hidden by Default) */
.dropdown-content {
margin-top: 10px;
display: none;
position: absolute;
background-color: #37979f;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
/* Links inside the dropdown */
.dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
color: #ffffff;
}
/* Change color of dropdown links on hover */
.dropdown-content a:hover {
background-color: #37979f;
border:1px solid;
}
/* Show the dropdown menu on hover */
.dropdown:hover .dropdown-content {
display: block;
}
/* Change the background color of the dropdown button when the dropdown content is shown */
.dropdown:hover .dropbtn {
background-color: #3e8e41;
}
HTML:
<div id="navbar" class="navbar-collapse collapse">
<ul class="navbar-right nav navbar-nav" style="background-color:#6FC2E3";>
<!-- Hidden li included to remove active class from about link when scrolled up past about section -->
<li class="active" >
<a class="page-scroll" href=".">Home</a>
</li>
<li>
<a class="page-scroll" href="./solutions">Solutions</a>
</li>
<li>
<div class="dropdown">
<a class="page-scroll" href="../services">Services</a>
<div class="dropdown-content">
<a class="page-scroll" href="../services/consulting.html">Consulting</a>
<a class="page-scroll" href="../services/development.html">Development</a>
<a class="page-scroll" href="../services/support.html">Support</a>
<a class="page-scroll" href="../services/managed-services.html">Managed Services</a>
</div>
</div>
</li>
<li>
<a class="page-scroll" href="./products">Products</a>
</li>
<li>
<a class="page-scroll" href="./blog">Blog</a>
</li>
<li>
<a class="page-scroll" href="./aboutus">About Us</a>
</li>
<li>
<a class="page-scroll" href="./contactus">Contact Us</a>
</li>
<li style="padding-top:13px;">
<font color="#DF0000 !important;" font size="4px;">Call: +61 449 176 002</font>
</li>
</ul>
</div>
why are you create new .dropdown class? already bootstrap have dropdown toogle refer this example it's working very well
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://getbootstrap.com/dist/js/bootstrap.js"></script>
<link href="http://getbootstrap.com/dist/css/bootstrap.css" rel="stylesheet"/>
<link href="http://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css" rel="stylesheet"/>
<div class="navbar navbar-inverse ">
<div class="container">
<!-- Header -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Bootstrap</a>
</div>
<!-- Navbar Links -->
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="active">Home</li>
<li>About</li>
<li>Contact</li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Services
<span class="caret"></span></a>
<ul class="dropdown-menu">
<li>Page 1-1</li>
<li>Page 1-2</li>
<li>Page 1-3</li>
</ul>
</li>
</ul>
</div>
</div>
</div>

Responsive bootstrap menu issues

So my app has a primary menu and then once a user is logged in, a secondary menu. Works fine and looks fine with full size (first image shown). When my app hits its media queries as shown in code below, thats why things are getting messed up and despite my best efforts, I am having issues. Let me show images and then tell more of what is happening after.
So at full screen with user logged in, both menus show as:
But then when go to a tablet size of 768px in width, this is where the issues start. You can see that the drop down arrow not right for top menu, and secondary menu, no arrow at all. You can also see that the text that shows for the top menu has a bad z-index despite my updates and changes.
So my menu (outside of the angular injection for what shows) is mainly in the index.html for the top menu, then the secondary (as shown in the code) gets brought in via a partial.
<div class="navbar navbar-inverse" role="navigation" ng-controller="indexController" style="border-bottom: #ab2328 3px solid;">
<div class="container">
<div class="navbar-header">
<button class="btn btn-success navbar-toggle" ng-click="navbarExpanded = !navbarExpanded">
<span class="glyphicon glyphicon-chevron-down"></span>
</button>
<a ng-show="!isSWA" class="navbar-brand" href="http://www.naviabenefits.com" target="_blank"><img style="height: 37px;" src="ppt/assets/navia.png"></a>
<a ng-show="isSWA" class="navbar-brand" href="http://pebb.naviabenefits.com/" target="_blank"><img style="height: 37px;" src="ppt/assets/navia.png"></a>
</div>
<div class="collapse navbar-collapse" collapse="!navbarExpanded">
<!-- pebb main nav -->
<ul ng-show="isSWA" class="nav navbar-nav navbar-right" >
<li ng-show="authentication.isAdmin">admin</li>
<li>benefits we offer</li>
<li>enrollment</li>`
<li>forms</li>
<li>faq</li>
<li>IIAS merchant list</li>
<li>about us</li>
<li>contact us</li>
<li ng-show="authentication.isAuth"><a id="signOut" href="#/logout">log out <i class="fa fa-sign-out"></i></a></li>
</ul>
<ul ng-show="!isSWA" class="nav navbar-nav navbar-right">
<li ng-show="authentication.isAdmin">admin</li>
<li>products + services</li>
<li>about us</li>`
<li>testimonials</li>
<li>careers</li>
<li>news</li>
<li>blog</li>
<li>contact us</li>
<li ng-show="authentication.isAuth"><a id="signOut" href="#/logout">log out <i class="fa fa-sign-out"></i></a></li>
</ul>
</div>
</div>
</div>
<div class="navbar navbarSecondary navbar-inverse" role="navigation" ng-controller="indexController" ng-show="authentication.isAuth">
<div class="container">
<div ng-include="'ppt/views/menu.html'">
</div>
</div>
</div>
<div class="container-fluid">
<div ng-view="">
</div>
</div>
You can see in the div with the ng-include, I am calling the partial and that code is:
<div class="navbarSecondary collapse navbar-collapse" collapse="!navbarExpanded">
<ul class="nav navbar-nav navbar-left">
<li>
<a href="#/pptHome">
Participants Home
</a>
</li>
<!-- secondary menu for SWA -->
<li class="dropdown" ng-show="isSWA">
<a href="http://pebb.naviabenefits.com/benefits/" target="_blank" class="dropdown-toggle" data-toggle="dropdown">
Benefits We Offer
<span class="caret">
</span>
</a>
<ul class="dropdown-menu sub-menu">
<li>
<a href="http://pebb.naviabenefits.com/benefits/health-care-fsa/" target="_blank" >
Medical Flexible Spending Arrangement
</a>
</li>
<li>
<a href="http://pebb.naviabenefits.com/benefits/dependent-care-assistance-program/" target="_blank" >
Dependent Care Assistance Program
</a>
</li>
<li>
<a href="http://pebb.naviabenefits.com/benefits/fsa-vs-hsa/" target="_blank" >
FSA vs. HSA Comparison
</a>
</li>
</ul>
</li>
<li class="dropdown" ng-show="!isSWA">
<a href="https://www.naviabenefits.com/participants/benefits/" target="_blank" class="dropdown-toggle" data-toggle="dropdown">
Benefits & Info
<span class="caret">
</span>
</a>
<ul class="dropdown-menu sub-menu">
<li>
<a href="https://www.naviabenefits.com/participants/benefits/health-care-fsa/" target="_blank" ng-show="hasMenuBenefit('HealthCare')">
Health Care FSA
</a>
</li>
<li>
<a href="https://www.naviabenefits.com/participants/benefits/day-care-fsa/" target="_blank" ng-show="hasMenuBenefit('DayCare')">
Day Care FSA
</a>
</li>
<li>
<a href="https://www.naviabenefits.com/participants/benefits/limited-health-care/" target="_blank" ng-show="hasMenuBenefit('Limited')">
Limited Health Care FSA
</a>
</li>
<li>
<a href="https://www.naviabenefits.com/participants/benefits/hsa/" target="_blank" ng-show="hasMenuBenefit('HSA')">
Health Savings Account (HSA)
</a>
</li>
<li>
<a href="https://www.naviabenefits.com/participants/benefits/gonavia-commuter-benefits/" target="_blank" ng-show="hasMenuBenefit('GoNavia')">
GoNavia Commuter Benefits
</a>
</li>
<li>
<a href="https://www.naviabenefits.com/participants/benefits/health-reimbursement-arrangement/" target="_blank" ng-show="hasMenuBenefit('HRA')">
Health Reimbursement Arrangement (HRA)
</a>
</li>
<li>
<a href="https://www.naviabenefits.com/participants/benefits/dental-reimbursement-plan/" target="_blank" ng-show="hasMenuBenefit('DirectReimb')">
Direct Reimbursement Plan
</a>
</li>
<li>
<a href="https://www.naviabenefits.com/participants/benefits/cobra/" target="_blank" ng-show="hasMenuBenefit('COBRA')">
COBRA
</a>
</li>
</ul>
</li>
<!-- secondary menu for SWA -->
<li class="dropdown" ng-show="isSWA">
<a href="http://pebb.naviabenefits.com/tools/" target="_blank" class="dropdown-toggle" data-toggle="dropdown">
Tools & Resources
<span class="caret">
</span>
</a>
<ul class="dropdown-menu sub-menu">
<li>
<a href="http://pebb.naviabenefits.com/benefits/expenses/" target="_blank">
Expenses
</a>
</li>
<li>
<a href="http://pebb.naviabenefits.com/tools/navia-benefits-card/" target="_blank">
Navia Debit Card
</a>
</li>
<li>
<a href="http://pebb.naviabenefits.com/tools/mynavia-mobile-app/" target="_blank">
MyNavia Mobile App
</a>
</li>
<li>
<a href="http://pebb.naviabenefits.com/tools/tax-savings-calculator/" target="_blank">
Tax Savings Calculator
</a>
</li>
</ul>
</li>
<li class="dropdown" ng-show="!isSWA">
<a href="https://www.naviabenefits.com/participants/resources/" target="_blank" class="dropdown-toggle" data-toggle="dropdown">
Tools & Resources
<span class="caret">
</span>
</a>
<ul class="dropdown-menu sub-menu">
<li>
<a href="https://www.naviabenefits.com/participants/resources/expenses/" target="_blank">
Expenses
</a>
</li>
<li ng-show="hasMenuBenefit('BenefitCard')">
<a href="https://www.naviabenefits.com/participants/resources/benefits-card/" target="_blank">
Navia Benefits Debit Card
</a>
</li>
<li ng-show="hasMenuBenefit('MobileApp')">
<a href="https://www.naviabenefits.com/participants/resources/mynavia-app/" target="_blank">
MyNavia Mobile App
</a>
</li>
<li ng-show="hasMenuBenefit('FlexConnect')">
<a href="https://www.naviabenefits.com/participants/resources/flex-connect/" target="_blank">
FlexConnect
</a>
</li>
<li ng-show="hasMenuBenefit('OnlineClaim')">
<a href="https://www.naviabenefits.com/participants/resources/online-claim-submission/" target="_blank">
Online Claim Submission
</a>
</li>
<li ng-show="hasMenuBenefit('OnlineSubst')">
<a href="https://www.naviabenefits.com/participants/resources/online-debit-card-substantiation/" target="_blank">
Online Debit Card Substantiation
</a>
</li>
<li>
<a href="https://www.naviabenefits.com/participants/resources/tax-savings-calculator/" target="_blank">
Tax Savings Calculator
</a>
</li>
<li>
<a href="https://www.naviabenefits.com/participants/resources/tutorial-videos/" target="_blank">
Tutorial Videos
</a>
</li>
<li>
<a href="https://www.naviabenefits.com/participants/resources/faq/" target="_blank">
FAQ
</a>
</li>
<li>
<a href="https://www.naviabenefits.com/participants/resources/forms-documents/" target="_blank">
Forms & Documents
</a>
</li>
</ul>
</li>
</ul>
</div>
And finally, with my over rides to bootstrap for color, font, etc..., my CSS is as (took out the media breakpoints as none were working as expected):
.navbar {
background-color: #ffffff;
height: 60px;
color: #000000;
font-size: 15px;
font-family: 'Open Sans', 'Helvetica Neue', 'Helvetica', 'Arial', 'sans-serif';
border: none;
margin-bottom: 0px;
}
.navbarSecondary {
background-color: #ab2328;
height: 66px;
color: #000000;
padding-left: 0px;
}
.navbarSecondary > li.dropdown.open > ul {
background-color: #2dccd3;
color: #ffffff;
}
.navbar.navbarSecondary.navbar-inverse.ng-scope > div > div > div > ul > li > a:hover, .navbar.navbarSecondary.navbar-inverse.ng-scope > div > div > div > ul > li > a:active, .navbar.navbarSecondary.navbar-inverse.ng-scope > div > div > div > ul > li > a:focus {
background-color: #68070b;
}
.navbarSecondary.navbar-inverse.ng-scope > div > div > div > ul > li > a {
font-size: 20px;
padding: 20px 25px 20px 25px;
color: #ffffff;
}
#signOut {
padding: 6px 10px;
background-color: #ab2328;
color: #ffffff;
margin-top: 10px;
}
#signOut:hover, #signOut:active {
background-color: #68070b;
}
.sub-menu {
background-color: #2dccd3;
padding-top: 18px;
padding-bottom: 18px;
}
.sub-menu > li > a {
color: #ffffff;
font-size: 12px;
line-height: 15.6px;
padding: 8px 25px 8px 40px;
}
.sub-menu > li > a:hover {
background-color: #24a4a9;
color: #ffffff;
}
.navbar-inverse .navbar-nav > li >a {
color: #2d3130;
}
.navbar-inverse .navbar-nav > li > a:hover, .navbar-inverse .navbar-nav > li > a:active {
color: #ab2328;
}
I have tried asnd tried using chrome dev tools and setting media breakpoints to no avail to get this work. Am hoping some of you can chime and in give some help. Is much appreciated.

Creating drop menus inside `sidebar-nav`

Please hvae a look at the below code
<div id="main-sidebar-wrapper" style="margin-top:50px; width:150px;">
<ul class="sidebar-nav" style="margin-top:10px;">
<!-- <li> Face Sheet </li> -->
<li class="li_active"> History </li>
<li> Problems </li>
<li> Medications </li>
<!-- <li> Immunizations </li> -->
<li > Allergies </li>
<li> Vitals </li>
<li> Examinations </li>
<li > Counseling </li>
<li> Demographics </li>
<hr>
<li>Documents Upload
<ul class="sub-menu">
<li>E.C.G</li>
</ul>
</li>
<!-- <li> Documents </li> -->
</ul>
</div>
Here, the Documents Upload section, I want it to be a drop-up menu or drop-right side menu. How can I do this?
#media (min-width: 768px) {
.navbar-collapse {
height: auto;
border-top: 0;
box-shadow: none;
max-height: none;
padding-left:0;
padding-right:0;
}
.navbar-collapse.collapse {
display: block !important;
width: auto !important;
padding-bottom: 0;
overflow: visible !important;
}
.navbar-collapse.in {
overflow-x: visible;
}
.navbar
{
max-width:300px;
margin-right: 0;
margin-left: 0;
}
.navbar-nav,
.navbar-nav > li,
.navbar-left,
.navbar-right,
.navbar-header
{float:none !important;}
.navbar-right .dropdown-menu {left:0;right:auto;}
.navbar-collapse .navbar-nav.navbar-right:last-child {
margin-right: 0;
}
}
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<!-- Jquery CDN -->
<script src="https://code.jquery.com/jquery-2.1.2.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<nav class="navbar navbar-default" role="navigation">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Brand</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav">
<li class="active">Link</li>
<li>Link</li>
<li class="dropdown">
Dropdown <b class="caret"></b>
<ul class="dropdown-menu">
<li>Action</li>
<li>Another action</li>
<li>Something else here</li>
<li>Separated link</li>
<li>One more separated link</li>
</ul>
</li>
</ul>
<form class="navbar-form navbar-left" role="search">
<div class="form-group">
<input type="text" class="form-control" placeholder="Search">
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
</div><!-- /.navbar-collapse -->
</nav>
Please find updated fiddle.
Need to do some change in
<li>Documents Upload
<ul class="sub-menu">
<li>E.C.G</li>
</ul>
</li>
I have made required changes. Please go through the link.
This is similar to how the dropdown menus work on mobile, may help.
body,
html {
height: 100%;
}
.sidebar-fixed {
padding: 5px 18px;
position: fixed;
width: 175px;
height: 100%;
top: 0;
left: 0;
background: #f5f5f5;
}
.sidebar-fixed #drop-one {
list-style: none;
text-align: left;
}
.sidebar-fixed #drop-one > li {
padding-top: 10px;
font-size: 13px;
}
.sidebar-fixed #drop-one > li >a {
color: #555;
text-decoration: none;
}
ul.sidebar-list {
list-style: none;
display: inline;
text-align: left;
}
ul.sidebar-list > li {
font-size: 18px;
padding-bottom: 25px;
}
ul.sidebar-list > li > a {
color: #555;
text-decoration: none;
}
.main-content {
margin-left: 175px;
padding-top: 5px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />
<div class="sidebar-fixed" id="sideNavParent">
<ul class="sidebar-list">
<li> Sidebar
</li>
<li> Something
</li>
<li> Something <span class="caret"></span>
<ul id="drop-one" class="collapse" data-parent="#sideNavParent">
<li> Something
</li>
<li> Something
</li>
<li> Something
</li>
<li> Something
</li>
</ul>
</li>
</ul>
</div>
<div class="main-content">
<div class="container-fluid">
<div class="alert alert-info">Main Content</div>
</div>
</div>