Align the navbar-brand to left of page - navbar

How do I align the navbar-brand to the left of the page? I would like my Website Name to be in the same line with the menu list.
This is my current menu bar:
Current Navigation Bar
Notice, in my Current Navigation Bar, my Website Name is above the menu list.
Here is my code saved at Bootply.com:
https://www.bootply.com/ksxCEDHXPo
Many thanks.

I figured it out. I wanted my menu to look like this:
Click here for my expected navigation menu
I needed to put the column span to the navbar-brand and navbar-collapse parameter.
This was my code before:
Website Name
</div>
<div class="collapse navbar-collapse" id="myNavbar">
Here is my code for the update:
<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="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand col-md-4" href="#">Awesome Theme</a>
</div> <!-- nav-header -->
<div class="collapse navbar-collapse col-md-8" id="myNavbar">
<?php
wp_nav_menu(array(
'theme_location'=>'primary',
'container' => false,
'menu_class'=>'nav navbar-nav navbar-right'
)
);
?>
</div><!-- collapse -->
</div><!-- container-fluid -->
</nav>
For more information on columns check out the site below:
https://www.w3schools.com/bootstrap/bootstrap_grid_system.asp

Related

Responsive nav bar menu not working on mobile browser (handlebars # ResearchSpace)

I'm running this ResearchSpace (RS) instance: https://www.magnetic-margins.com
In the header.hbs file, all seems to be set for a use of the navbar on mobile devices, but the dropdown won't work because the collapse event is not triggered, I think. I can make it permanently collapsed for mobiles but I fail to make the actual dropdown work!
RS is using React Bootstrap 3. The corresponding lines in the header.hbs file are:
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="rs-header">
<!-- 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="#rs-navbar"
aria-expanded="false" aria-controls="rs-navbar" aria-label="Toggle navigation">
<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="rs-header-logo" href="/" title="{{deploymentTitle}}"><img class="img-responsive" src="https://docs.google.com/drawings/d/e/2PACX-1vRKgdbvCgd7aA4xA3nCR21qrQpFvD6ryeqhLHJ2z15oDVb8lBMVLyPgOwRAiJxpUMVPK7HUvcogCVW9/pub?h=70"/></a>
</div>
​
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="rs-navbar">
​
<ul class="nav navbar-nav">
{{!-- <li>
<semantic-link iri="http://www.researchspace.org/resource/ThinkingFrames"
urlqueryparam-view='system-projects' class="rs-body-m-B" style="padding-left: 60px;">
Projects
</semantic-link>
</li> --}}
</ul>
​
<ul class="nav navbar-nav icon-btns-container">
​
​ <li>
<semantic-link uri="http://www.researchspace.org/resource/magnet_Persons">
<div class="nav-iconAndLabel">
<i class="fa fa-users"></i>
<div>Persons</div>
</div>
</semantic-link>
</li>
...
This bug seems to apply to all RS instances I checked, but, e.g., works on a Metaphacts implementation of http://db.sphaera.mpiwg-berlin.mpg.de/resource/Start

Collapsing Navigation Bar, Bootstrap

I coded my HTML index to have the navigation bar replaced by a button when the screen gets narrower. But, when the button is clicked, the navigation bar elements are not displayed as I expected. hope somebody can help me.
If I copy-paste the same nav-bar code into w3schools bootstrap simulator (http://www.w3schools.com/bootstrap/tryit.asp?filename=trybs_navbar_collapse&stacked=h) the elements do show up when I click the button (with narrow screen)
here is the piece of code I'm talking about:
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<img src="images/cuori.png" height="42" alt="Valentina e Andrea" title="Valentina e Andrea">Valentina e Andrea
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav navbar-right">
<li>Noi</li>
<li>Il Grande Giorno</li>
<li>Lista Nozze</li>
<li>Scrivici!</li>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>
<!-- Main jumbotron for a primary marketing message or call to action -->
<div class="jumbotron">
<div class="container">
<h1>Auguri a NOI! </h1>
</div>
</div>

Bootstrap navbar?

I would like to know why my website navbar in mobile won't close and open like I want. When the user clicks on those 3 bars, it should close and open in mobile view, but it just won't work. Here is the code for the navbar:
Here is my website. Just resize it, and you will see that it just stays there and won't close like I want it to.
Here is the website:
http://edgaraxe.net/
<div class = "navbar navbar-default navbar-static-top" >
<div class = "container">
<!--Navigation -->
<div class="navbar-header">
<a class="navbar-brand">Edgar Axelsson</a>
<button class="navbar-toggle" data-toggle="collapse" data-target=".navHeaderCollapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div>
<div class "collapse navbar-collapse navHeaderCollapse">
<ul class = "nav navbar-nav navbar-right">
Try using id on your data-target. Try
<button class="navbar-toggle" data-toggle="collapse" data-target="#testnavbar" aria-expanded="true">
on your button and
<div class="collapse in" "collapse="" navbar-collapse="" navheadercollapse"="" id="testnavbar" aria-expanded="true">
on your div.
Also, note that your div does not have an = on your class - that seems to be a typo, so the div line should look like:
<div class="collapse navbar-collapse navHeaderCollapse" id="testnavbar">

Bootstrap - How do I get a responsive nav bar that outputs a Menu button and drops your lists down when you resize your browser?

I want to make a nav bar that automatically turns into a Menu button and collapses when you minimize your browser
I want it to be exactly like this one http://php1.emagid.net/~laurenbe/
I looked up tutorials but every tutorial only teaches us how to do the bar static to the top of the page. Any suggestions?
This is part of bootstrap, the Navbar
At it's most basic, you want to do this:
<nav class="navbar navbar-default" role="navigation">
<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>
<div class="btn btn-primary">Menu</div>
</button>
<a class="navbar-brand" href="#">Brand</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="active">Link</li>
<li>Link</li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
You can then use custom CSS styles to over-ride bootstraps native styling.
It's all about responsive design, so you can have help here : http://getbootstrap.com/css/#grid.
Here : http://getbootstrap.com/css/
And a beginner video for bootstrap if you're not familiar with it : https://www.youtube.com/watch?v=no-Ntkc836w

Customize bootstrap navbar

Hi I am trying to customize the boostrap default navbar.
I do not expect you to do all my work, but I need help to style the li field so it hangs over the navbar.
How do I make that?
Code I have:
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#mainNavigation-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 hidden-lg hidden-md hidden-sm" href="#">Caleum Wellness</a>
</div>
<div class="collapse navbar-collapse" id="mainNavigation-collapse">
<ul class="nav navbar-nav">
<li class="active">Om oss</li>
<li>Behandlingar</li>
<li>Tidsbokning</li>
<li>Blogg</li>
<li>Kontakta</li>
</ul>
</div>
</div>
</nav>
The first image show how it is now, and the second image is how I want it.
You can try the Bootstrap customizer http://getbootstrap.com/customize/
Just change less variables how you want and then download it.
Solved the issue by creating a background image with height lower than the navigation wrapper.
The wrapper is still the same size but it looks like it is smaller.