I am using bootstrap, and the default for mobile navigation is 768px. I want to expand this to 979px instead? I have search and try anything for hours but with no luck at all. Can someone help me with this problem?
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<div class="col-md-4" style="background-color:coral;">
<div id="divLogo" class="pull-left">
<img src="~/Images/logo.png" />
</div>
</div>
<div class="col-lg-8" style="background-color:crimson;">
<div id="divMenuRight">
<div class="navbar">
<button type="button" class="navbar-toggle btn btn-navbar-highlight btn-large btn-primary" data-toggle="collapse" data-target=".navbar-collapse">
NAVIGATION <span class="icon-chevron-down icon-white"></span>
</button>
<div class="navbar-collapse collapse">
<ul class="nav nav-pills ddmenu">
<li class="active">#Html.ActionLink("Home", "Index", "Home")</li>
<li class="dropdown">
Transport <b class="caret"></b>
<ul class="dropdown-menu">
<li>#Html.ActionLink("Medicin", "Medicin", "Home")</li>
<li>#Html.ActionLink("Køl / Varme / Frost", "Temperaturkontrolleret", "Home")</li>
<li>#Html.ActionLink("ADR", "ADR", "Home")</li>
<li>#Html.ActionLink("Express", "Express", "Home")</li>
<li>#Html.ActionLink("Flytninger", "Flytninger", "Home")</li>
<li>#Html.ActionLink("SLV", "SLV", "Home")</li>
<li>#Html.ActionLink("Dyr", "Dyr", "Home")</li>
<li>#Html.ActionLink("Håndvåben", "Weapons", "Home")</li>
<li>#Html.ActionLink("England Tur/Retur", "TurRetur", "Home")</li>
</ul>
</li>
<li>#Html.ActionLink("Priser", "Priser", "Home")</li>
<li>#Html.ActionLink("Nyheder", "Nyheder", "Home")</li>
<li>#Html.ActionLink("Kontakt", "Kontakt", "Home")</li>
<li>#Html.ActionLink("Job", "Vognmand", "Home")</li>
<li>
<a class="hideButtonDk" href="#Url.Action("Change", "Home", new { Lang = "da"})">
<img src="#Url.Content("~/Images/icon_uk.png")" />
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</nav>
You will need to download a custom build of bootstrap from their site and update the default in the "Media queries breakpoints" section.
Update the width for the "screen-sm" variable from 768px to the desired value.
http://getbootstrap.com/customize/
Related
I have a login page, but whenever I typed wrong credentials it showing the mainheader for login person but with no name.. See the image I attached for further explanations
login
login with wrrong credentials
this is what it look like when the person login successfully, it have name and company
View form
<ul class="nav navbar-nav navbar-right">
#{
AccountContactVM customer = (AccountContactVM)ViewBag.AccountData;
}
#if (customer.User == customer.User && customer.User != null )
{
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<i class="fa fa-user-circle fa-fw fa-lg" aria-hidden="true"</i>
#customer.User.FirstName #customer.User.LastName
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li class="disabled">
<div class="row">
<div class="col-md-3">
<i class="fa fa-user-circle" style="font-size:40px;padding:5px 20px;" aria-hidden="true"></i>
</div>
<div class="col-md-9">
<p style="padding-top:5px;">
#customer.User.FirstName #customer.User.LastName
<br />
#customer.Company.AccountName
</p>
</div>
</div>
</li>
<li class="divider"></li>
<li><a asp-controller="Account" asp-action="Index">Customer Portal</a></li>
<li class="divider"></li>
<li><a a asp-controller="Account" asp-action="LogOut">Logout</a></li>
</ul>
</li>
}
else
{
<li><a asp-controller="Account" asp-action="SignUp">Register</a></li>
<li><a asp-controller="Account" asp-action="SignIn"><i class="fa fa-sign-in fa-fw" aria-hidden="true"></i>Login</a></li>
}
<li ng-cloak><span class="glyphicon glyphicon-shopping-cart"></span></i>Cart(<strong>{{CartCount}}</strong>)</li>
</ul>
Below is my code snippet:
<div class="container">
<div class="row">
<div class="col-sm-10 col-sm-offset-1">
<nav class="navbar navbar-default">
<div class="navbar-header">
<a class="navbar-brand" href="#">This is a LOGO </a>
</div>
<ul class="nav navbar-nav pull-right">
<li><a href="#" > Abous US </a></li>
<li><a href="#" > Contact US </a></li>
<li><a href="#" > Acount </a></li>
</ul>
</nav>
</div>
</div>
</div>
My question: How can I pull ABOUT US and CONTACT US items into the right and the ACOUNT is in the left?
As per the docs, you can use navbar-right to pull some elements to the right:
<ul class="nav navbar-nav navbar-right">
<li>Link</li>
<li class="dropdown">
Dropdown <span class="caret"></span>
<ul class="dropdown-menu">
<li>Action</li>
<li>Another action</li>
<li>Something else here</li>
<li role="separator" class="divider"></li>
<li>Separated link</li>
</ul>
</li>
</ul>
I have a nav-pills menu, and when it collapse it is horizontal. I would like a menu like the navbar when it is collapse. I have search the internet, the only soloution was to make to menus and I don´t think that is the best soloution.
<div class="navbar">
<button type="button" class="navbar-toggle btn btn-navbar-highlight btn-large btn-primary" data-toggle="collapse" data-target=".navbar-collapse">
NAVIGATION <span class="icon-chevron-down icon-white"></span>
</button>
<div class="navbar-collapse collapse" style="background-color:deeppink;">
<ul class="nav navbar ddmenu">
<li class="dropdown active">#Html.ActionLink("Home", "Index", "Home")</li>
<li class="dropdown">
Transport <b class="caret"></b>
<ul class="dropdown-menu">
<li>#Html.ActionLink("Medicin", "Medicin", "Home")</li>
<li>#Html.ActionLink("Køl / Varme / Frost", "Temperaturkontrolleret", "Home")</li>
<li>#Html.ActionLink("ADR", "ADR", "Home")</li>
<li>#Html.ActionLink("Express", "Express", "Home")</li>
<li>#Html.ActionLink("Flytninger", "Flytninger", "Home")</li>
<li>#Html.ActionLink("SLV", "SLV", "Home")</li>
<li>#Html.ActionLink("Dyr", "Dyr", "Home")</li>
<li>#Html.ActionLink("Håndvåben", "Weapons", "Home")</li>
<li>#Html.ActionLink("England Tur/Retur", "TurRetur", "Home")</li>
</ul>
</li>
<li class="dropdown">#Html.ActionLink("Priser", "Priser", "Home")</li>
<li class="dropdown">#Html.ActionLink("Nyheder", "Nyheder", "Home")</li>
<li class="dropdown">#Html.ActionLink("Kontakt", "Kontakt", "Home")</li>
<li class="dropdown">#Html.ActionLink("Job", "Vognmand", "Home")</li>
<li>
<a class="hideButtonDk" href="#Url.Action("Change", "Home", new { Lang = "da"})">
<img src="#Url.Content("~/Images/icon_uk.png")" />
</a>
</li>
</ul>
</div>
</div>
Hope someone could help me with this soloution
I solved it with this one
.nav-pills.ddmenu > li{
width: 100%;
}
and in dropdown menu
.nav-pills > li > .dropdown-menu{
height:auto;
width:98%;
}
I have the following navigation on MVC using bootstrap, how can I make the Storage Menu Link (second li ) as a drowndown to include Add and View Links without removing the #ActionLink?
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="brand" href="/Home/Home">News Library</a>
<div class="nav-collapse collapse">
<ul class="nav">
<li class="#ActiveLink("Home", "Home", null)">#Html.ActionLink("Home", "Home", "Home")</li>
<li class="#ActiveLink("About", "Home", null)">#Html.ActionLink("Storage", "Add", "Storage")</li>
<li class="#ActiveLink("Contact", "Home", null)">#Html.ActionLink("Activites", "Add", "Activites")</li>
<li class="#ActiveLink("Contact", "Home", null)">#Html.ActionLink("Search", "Index", "Search")</li>
</ul>
<ul class="nav pull-right">
<li>#Html.ActionLink("[Log Out]", "Logout", "Home")</li>
</ul>
</div>
</div>
</div>
</div>
<li class="#ActiveLink("Home", "Home", null) dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
Storage
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>#Html.ActionLink("Storage", "Add", "Storage")</li>
<li>#Html.ActionLink("Storage", "View", "Storage")</li>
</ul>
</li>
See the bootstrap site for more information
Here is my layout code, I'm using Bootstrap v3.0 and Using ASP.NET MVC. The page has to be responsive, I tried using "space-20" just below the render body content, it works but it doesn't work on small screens. I'm an absolute beginner in ASP.NET MVC
<div class="navbar navbar-fixed-top">
<div class="navbar-inner clearfix">
<div class="container">
#Html.ActionLink("Grikwa Store", "Index", "Home", null, new { #class = "navbar-brand clearfix" })
<div class="navbar-left">
#Html.Partial("_SearchPartial")
</div>
</div>
</div>
<div class="navbar-inner navbar-inverse" style="background-color: #68217a;">
<div class="container">
<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>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>#Html.ActionLink("Home", "Index", "Home")</li>
<li>#Html.ActionLink("About", "About", "Home")</li>
<li>#Html.ActionLink("Contact", "Contact", "Home")</li>
<li>#Html.ActionLink("Admin", "Admin", "Account")</li>
</ul>
#Html.Partial("_LoginPartial")
</div>
</div>
</div>
</div>
<div class="container body-content">
#RenderBody()
</div>
You just need to add some padding to your body-content class.
.body-content {
padding-top: 36px; /* choose whatever you want here */
}
This happens because you have your navbar set to fixed, which is taken out of the normal flow.