Bootstrap is not working on this component - html

The bootstrap is applied on the search button and the shopping cart icon but not the rest. The bootstrap does not work on the nav bar. Not sure if its just a typo problem but I got it to work earlier and then it crashed
<div class="myclass">
<nav id="myid" class="navbar navbar-dark bg-primary navbar-fixed-top" style="background-color: #171d20; height: 60px">
<form id="page" class="form-inline">
<ul class="nav navbar-nav">
<li><a class="hello" routerLink="Userlogin/home" href="">Home</a></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Departments </a>
<ul class="dropdown-menu">
<li>department 1</li>
<li>department 2</li>
<li>department 3</li>
</ul>
</li>
<li (click)="onLogin()" *ngIf="!isLoggedIn">
<a routerLink="/Userlogin" class="hello" href="#">Login & Signup</a>
</li>
<li><a routerLink="/profile" class="hello" href="#">Profile</a></li>
<li *ngIf="isLoggedIn" class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">{{ username }}
</a>
<ul class="dropdown-menu">
<li><a routerLink="/Userlogin/orders" href="#2">Orders</a></li>
<li><a (click)="onLogout()">Logout</a></li>
</ul>
</li>
<li><a routerLink="Userlogin/cart" class="hello" href="#"> Cart</a></li>
<li><a routerLink="/login" class="hello" href="#">Admin</a></li>
</ul>
<div>
<a style="margin-left: 180px; margin-top: 3px; font-size: medium" class="navbar-brand">Shop24X7</a>
</div>
<input [(ngModel)]="search" name="search" size="40" style="margin-top: 11px" class="form-control mr-sm-2"
type="search" placeholder="Search for product" aria-label="search" />
<button (click)="onSearch()" style="margin-top: 11px" class="btn btn-info" type="submit">
Search
</button>
<a class="nav-link" routerLink="cart" class="fa fa-shopping-cart mr-1">
<img routerLink="cart" src="https://img.icons8.com/cute-clipart/64/000000/food-cart.png" />
</a>
</form>
</nav>
<router-outlet></router-outlet>
</div>

Related

Multi-level Dropdown in bootstrap 3.3.4

So i am trying to accomplish a multi-level dropdown as the title says. I am only getting one level and the second level is not appearing. I am not sure what I am missing. Here is what I have:
<div class="collapse navbar-collapse" id="conference-dropdowns">
<ul class="nav navbar-nav">
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">AFC<span class="caret"></span></a>
<ul class="dropdown-menu multi-level" role="menu">
<li class="dropdown-submenu">
<li>AFC South</li>
<ul class="dropdown-menu">
<li>Colts</li>
</ul>
</li>
</ul>
</li>
</ul>
<form class="navbar-form navbar-left" role="search">
<div class="form-group">
<input class="form-control" placeholder="Search" type="text">
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
<ul class="nav navbar-nav navbar-right">
<li>Logout</li>
</ul>
</div>
I am on bootstrap 3.3.4 and just get AFC for Dropdown and inside only AFC South shows up. No submenu for it. any help would be great. thanks. I am also using bootswatch spacelab
I hope this is what you were looking for ^^
<div class="container">
<div class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown">AFC
<span class="caret"></span></button>
<ul class="dropdown-menu">
<li><a tabindex="-1" href="#">AFC South</a></li>
<li class="dropdown-submenu">
<a class="test" tabindex="-1" href="#">New dropdown <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a tabindex="-1" href="#">2nd level dropdown</a></li>
<li><a tabindex="-1" href="#">2nd level dropdown</a></li>
<!--<li class="dropdown-submenu">
<a class="test" href="#">Another dropdown <span class="caret"></span></a>
<ul class="dropdown-menu">
<li>3rd level dropdown</li>
<li>3rd level dropdown</li>-->
</ul>
</li>
</ul>
</div>
</div>
$(document).ready(function() {
$(".dropdown-submenu a.test").on("click", function(e) {
$(this)
.next("ul")
.toggle();
e.stopPropagation();
e.preventDefault();
});
});
JSFiddle
HTML
<div class="collapse navbar-collapse" id="conference-dropdowns">
<ul class="nav navbar-nav">
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">AFC <span class="caret"></span></a>
<ul class="dropdown-menu">
<!-- submenu-->
<li class="dropdown-submenu">
<a class="submenu" data-toggle="dropdown" href="#">AFC South <span class="caret"></span></a>
<ul class="dropdown-menu">
<li class="dropdown-submenu">
<a class="submenu" data-toggle="dropdown" href="#">Colts <span class="caret"></span></a>
<ul class="dropdown-menu">
<li>Red </li>
</ul>
</li>
</ul>
</li>
<!-- submenu || -->
</ul>
</li>
</ul>
</div>
CSS
.dropdown-submenu {
position: relative;
}
.dropdown-submenu .dropdown-menu {
top: 0;
left: 100%;
margin-top: -1px;
}
Codepen: Bootstrap 3 dropdown multilevel caret up
Here is what I found to work in testing it, now I just need to write it out dynamically using JS.
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<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 pull-left" href="#"><img id="logo" src="${pageContext.servletContext.contextPath}/static/images/aston.png"></a>
</div>
<div class="collapse navbar-collapse" id="conference-dropdowns">
<ul class="nav navbar-nav">
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">AFC<span class="caret"></span></a>
<ul class="dropdown-menu multi-level" role="menu" aria-labelledby="dropdownMenu">
<li class="dropdown-submenu">
<a tabindex="-1" href="#">AFC South</a>
<ul class="dropdown-menu">
<li>Colts</li>
<li>Jaguars</li>
<li>Titans</li>
<li>Texans</li>
</ul>
</li>
<li class="dropdown-submenu">
<a tabindex="-1" href="#">AFC North</a>
<ul class="dropdown-menu">
<li>Steelers</li>
<li>Ravens</li>
<li>Browns</li>
<li>Bengals</li>
</ul>
</li>
</ul>
</li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">NFC<span class="caret"></span></a>
<ul class="dropdown-menu multi-level" role="menu" aria-labelledby="dropdownMenu">
<li class="dropdown-submenu">
<a tabindex="-1" href="#">NFC North</a>
<ul class="dropdown-menu">
<li>Packers</li>
<li>Vikings</li>
<li>Lions</li>
<li>Bears</li>
</ul>
</li>
</ul>
</li>
</ul>
<form class="navbar-form navbar-left" role="search">
<div class="form-group">
<input class="form-control" placeholder="Search" type="text">
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
<ul class="nav navbar-nav navbar-right">
<li>Logout</li>
</ul>
</div>
</div>

Dropdown menu inside tabbable bootstrap

I am trying to integrate bootstrap tabs and dropdown menus using Bootstrap 2.3.4
<div class="container">
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container-fluid">
<div class="nav-no-collapse header-nav">
<ul class="nav pull-left nav-tabs">
<li class="dropdown">
<a href="/Home">
<i class="icon-bar-chart"></i></a>
</li>
<li class="dropdown"><i class="icon-refresh"></i>
</li>
<li>Development </li>
<li>Testing </li>
</ul>
</div>
</div>
<div class="container-fluid">
<div class="tab-content">
<div class="tab-pane fade" id="dev">
<ul class="nav pull-left">
<li class="dropdown"><a class="btn dropdown-toggle" data-toggle="dropdown" href="#">Dev</a>
<ul class="dropdown-menu">
<li>
Dev1
Dev2
Dev3
</li>
</ul>
</li>
</ul>
</div>
<div class="tab-pane fade" id="testing">
<ul class="nav pull-left">
<li class="dropdown"><a class="btn dropdown-toggle" data-toggle="dropdown" href="#">Staging</a>
<ul class="dropdown-menu">
<li>
Staging 1
Staging 2
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
But its not showing the dropdown menu properly
The menu goes somewhere and puts a scroll inside it.
JSFIDDLE Demo
You can fix your problem with just adding a simple line of
.tab-content{
overflow:inherit !important;
}
see demo below
.tab-content{
overflow:inherit !important;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
<script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<link href="http://netdna.bootstrapcdn.com/bootswatch/2.3.2/cerulean/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container-fluid">
<div class="nav-no-collapse header-nav">
<ul class="nav pull-left nav-tabs">
<li class="dropdown"><a href="/Home">
<i class="icon-bar-chart"></i></a></li>
<li class="dropdown"><a href="javascript:RefreshAll();"
title="Refresh All"><i class="icon-refresh"></i></a>
</li>
<li>Development </li>
<li>Testing </li>
</ul>
</div>
</div>
<div class="container-fluid">
<div class="tab-content">
<div class="tab-pane fade" id="dev">
<ul class="nav pull-left">
<li class="dropdown"><a class="btn dropdown-toggle" data-toggle="dropdown"
href="#">Dev</a>
<ul class="dropdown-menu">
<li>
Dev1
Dev2
Dev3
</li>
</ul>
</li>
</ul>
</div>
<div class="tab-pane fade" id="testing">
<ul class="nav pull-left">
<li class="dropdown"><a class="btn dropdown-toggle" data-toggle="dropdown"
href="#">Staging</a>
<ul class="dropdown-menu">
<li>
Staging 1
Staging 2
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>

Bootstrap 3 Dropdown menu is not working

I have a little problem with my dropdown menu. I can't get it to work. I've been searching for a few hours already and still nothing.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-center">
<li> <img src="img/wts-logo.png" style="width:40px; height:40px;" alt="World Travel Show" /> </li>
<li aria-haspopup="true" aria-expanded="false" class="dropdown" ><a data-toggle="dropdown" class="dropdown-toggle page-scroll" href="#page-top">WORLD TRAVEL SHOW</a><span class="caret"></span>
<ul class="dropdown-menu">
<li>O TARGACH</li>
<li>SALONY</li>
<li>DOJAZD</li>
<li>DLA MEDIÓW</li>
</ul>
</li>
<li> <a class="page-scroll" href="podroznicy.html">PODRÓŻNICY</a> </li>
<li> <a class="page-scroll" href="#adoba">ATRAKCJE</a> </li>
<li> <a class="page-scroll" href="#harmonogram">HARMONOGRAM</a> </li>
<li> <a class="page-scroll" href="#dojazd">DOJAZD</a> </li>
<li> <a class="page-scroll" href="#salony">SALONY</a> </li>
<li> <a class="page-scroll" href="#dla_wystawcow">O TARGACH</a> </li>
<li> <a class="page-scroll" href="#wystawcy">WYSTAWCY</a> </li>
<li> <a class="" href="http://targi.kadryturystyki.pl/" target="_blank">SZKOLENIA</a> </li>
<li> DLA MEDIÓW </li>
<li> <a class="page-scroll" href="#contact">KONTAKT</a> </li>
<li> <a class="page-scroll hidden-xs" href="#contact" id="logopwe" style="display:none;"><img src="img/pwe-logo.png" alt="Ptak Warsaw Expo" style="height:40px; width:40px;" /></a> </li>
</ul>
</div>
CodePen
The <span class="caret"></span> has to be inside the dropdown <a>...</a> tag.
Change
<a data-toggle="dropdown" class="dropdown-toggle page-scroll" href="#page-top">WORLD TRAVEL SHOW</a> <span class="caret"></span>
to
<a data-toggle="dropdown" class="dropdown-toggle page-scroll" href="#">WORLD TRAVEL SHOW <span class="caret"></span></a>
Bootply
http://www.bootply.com/wS18cO4pfA
Here is how I use Bootstrap dropdown, and it works fine:
<div class="btn-group">
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Button</button>
<ul class="dropdown-menu">
<div>Something</div>
</ul>
</div>
Good luck!

Align Navbar bottom-left

i'm working on this website and as you can see i've a vertical left navigation. How can i move the navigations link left-bottom (only on desktop) like this?
<header class="span3">
<div class="affix">
<div class="navbar span3">
<div class="navbar-inner">
<a class="btn btn-navbar" data-target=".nav-collapse" data-toggle="collapse">
<i class="icon-reorder"></i>
</a>
<a class="brand span2" href="index.html">
<img alt="" src="img/logo.png">
</a>
<nav class="nav-collapse collapse">
<ul class="nav">
<li class="nav-home active">Home</li>
<li class="nav-about">Philosophie</li>
<li class="nav-services">Menu</li>
<li class="nav-team">Team</li>
<li class="nav-reservation">Reservation und Öffnungszeiten</li>
<li class="nav-private">Private Dining</li>
<li class="nav-kontakt">Kontakt und Anreise</li>
</ul>
</nav>
</div><!-- /navbar-inner -->
</div><!-- /navbar -->
<!-- <aside class="span3 text-center hidden-phone">
<ul class="social inline">
<li><a class="btn btn-small" href="#"><i class="icon-facebook"></i></a></li>
<li><a class="btn btn-small" href="#"><i class="icon-twitter"></i></a></li>
<li><a class="btn btn-small" href="#"><i class="icon-linkedin"></i></a></li>
</ul>
</aside> -->
</div><!-- /affix -->
</header>
#media(min-width:1024px)
{
/* your style for desktop */
}

how to make full width mega menu in bootstrap

I want to implement full width mega menu in bootstrap. here is markup for menu:
<nav class="navbar navbar-inverse navbar-static-top">
<div class="container-fluid">
<div class="navbar-header"><a class="navbar-brand" href="#"><b>eTouch</b></a></div>
<div>
<ul class="nav navbar-nav">
<li><a data-toggle="tab" href="#" class="btn"> <span class="glyphicon glyphicon-home"></span> </a>
<ul class="dropdown-menu mega-dropdown-menu row">
<div class="megamenu-headline"><h2>ODC VEGETABLES STORE</h2></div>
<li class="divider"></li>
<li class="col-sm-3">
<ul>
<li class="dropdown-header">Dresses</li>
<li>Unique Features</li>
<li>Image Responsive</li>
<li>Auto Carousel</li>
<li>Newsletter Form</li>
<li>Four columns</li>
<li class="divider"></li>
<li class="dropdown-header">Tops</li>
<li>Good Typography</li>
</ul>
</li>
<li class="col-sm-3">
<ul>
<li class="dropdown-header">Dresses</li>
<li>Unique Features</li>
<li>Image Responsive</li>
<li>Auto Carousel</li>
<li>Newsletter Form</li>
<li>Four columns</li>
<li class="divider"></li>
<li class="dropdown-header">Tops</li>
<li>Good Typography</li>
</ul>
</li>
<li class="col-sm-3">
<ul>
<li class="dropdown-header">Jackets</li>
<li>Easy to customize</li>
<li>Glyphicons</li>
<li>Pull Right Elements</li>
<li class="divider"></li>
<li class="dropdown-header">Pants</li>
<li>Coloured Headers</li>
<li>Primary Buttons & Default</li>
<li>Calls to action</li>
</ul>
</li>
<li class="col-sm-3">
<ul>
<li class="dropdown-header">Accessories</li>
<li>Default Navbar</li>
<li>Lovely Fonts</li>
<li>Responsive Dropdown </li>
<li class="divider"></li>
<li class="dropdown-header">Newsletter</li>
<form class="form" role="form">
<div class="form-group"><label class="sr-only" for="email">Email address</label>
<input type="email" class="form-control" id="email" placeholder="Enter email">
</div>
<button type="submit" class="btn btn-primary btn-block">Sign in</button>
</form>
</ul>
</li>
</ul>
</li>
<li> <span class="glyphicon glyphicon-user"></span> About </li>
<li> <span class="glyphicon glyphicon-wrench"></span> Services </li>
<li> <span class="glyphicon glyphicon-ok"></span> Solutions </li>
<li> <span class="glyphicon glyphicon-briefcase"></span> Products </li>
<li> <span class="glyphicon glyphicon-list"></span> Skills </li>
<!-- <li> <span class="glyphicon glyphicon-cog"></span> Industries </li>-->
<li> <span class="glyphicon glyphicon-picture"></span> Portfolio </li>
<li> <span class="glyphicon glyphicon-pencil"></span> Blog </li>
<li> <span class="glyphicon glyphicon-comment"></span> Contacts </li>
</ul>
</div>
</div>
</nav>
now i want full width mega menu on hover each element. like home, about, services etc
You are doing wrong here data-toggle="tab"
<li><a data-toggle="tab" href="#" class="btn"> <span class="glyphicon glyphicon-home"></span> </a>
Should be data-toggle="dropdown"
<li><a data-toggle="dropdown" href="#" class="btn"> <span class="glyphicon glyphicon-home"></span> </a>
Fiddle
Also Here is a mega menu I created for another answer, gives you complete idea what to do and what not to do.