bootstrap css searchbox not fit in navigation bar - html

In my jsp page I want to put searchbox in the navigation bar items.
So I have done below code,click in the link(jsfiddle code).
jsfiddlecode link
But the problem is,search bar is not fit into the navigation bar itmes,when it is in mobile view. why it is not fit into the navigation bar??

You can place the button and the search form inside the navbar-header div so it won't become mixed in with the mobile navbar when the toggle button is clicked since it's currently included inside the nav links. Then you just need to adjust the placement of the toggle button.
*I also adjusted your navbar-nav since it's overlapping the search button at certain widths.
See working example Snippet.
$('#buttonsearch').click(function() {
$('#formsearch').slideToggle("fast", function() {
$('#content').toggleClass("moremargin");
});
$('#searchbox').focus()
$('.openclosesearch').toggle();
});
body {
padding-top: 70px;
}
.searchbardiv {
display: block;
position: fixed;
background: #7D1935;
top: 50px;
right: 0px;
width: 100%;
max-width: 100%;
padding: 10px;
margin: 0px;
}
#formsearch {
display: none;
}
.buttonsearch {
position: fixed;
color: white;
top: 15px;
right: 10px;
background-color: transparent;
border: 0px;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
.buttonsearch:hover {
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
border: 0px;
}
.buttonsearch:focus {
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
outline: none;
border: 0px;
}
.glyphicon.glyphicon-search {
font-size: 18px;
}
#searchbox {
box-shadow: none;
padding: 8px 14px;
}
#searchbox:hover {
box-shadow: none;
}
.form-control:focus {
border-color: #ccc;
}
#media (min-width: 768px) {
.navbar .navbar-nav {
margin-right: 10px;
}
}
#media (max-width: 767px) {
.navbar .navbar-toggle {
margin-right: 50px;
}
}
<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.6/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-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="#">MyCompany</a>
<button type="button" class="buttonsearch" id="buttonsearch">
<i class="glyphicon glyphicon-search openclosesearch"></i>
<i class="glyphicon glyphicon-remove openclosesearch" style="display:none"></i>
</button>
<form role="search" method="get" class="searchbardiv" id="formsearch">
<div class="input-group">
<input type="text" id="searchbox" class="form-control" name="s" id="s">
<div class="input-group-btn">
<button class="btn btn-default" id="searchsubmit" type="submit">
<strong>Search</strong>
</button>
</div>
</div>
</form>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<li class="active">
Home
</li>
<li>
link1
</li>
</ul>
</div>
</div>
</nav>
<div class="container">
<div class="well">
Content
</div>
</div>

You can write media css for phone ..just add
#media (max-width: 767px) {
#buttonsearch{
margin-right:20%;
}
}
It will do margin-right to Landscape phone , portrait tablet to phone

Related

Bootstrap Toggler blocking Accordion Toggler?

Problem: I am designing a page using bootstrap 5/html/css. I made it responsive so with a specific width the boostrap 5 menu with toggler navbar shows. On the rest of the page, I want to add an accordion style menu. I've done tests and I know that there is nothing wrong with the code seperatly, but when I put them both on the same page and I click on the accordion tab to show, the page scrolls back up to the head. I think it has to do with the toggler navbar code, but I'm a student so I don't really know how to solve this so I came to ask you guys for help! Thanks :)
Here is the HTML:
<html lang="en" dir="ltr">
<head>
<meta content="width=device-width, initial-scale=1" name="viewport">
<meta charset="utf-8">
<title>eyo</title>
<!---CSS BOOTSTRAP--->
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.0.0-beta3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6" crossorigin="anonymous">
<!--FONTAWESOME-->
<script src="https://kit.fontawesome.com/9e552d07ce.js" crossorigin="anonymous"></script>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<!-- NavBar -->
<nav class="navbar sticky-top navbar-expand-lg">
<div class=" container-fluid">
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-
target="#navbarTogglerDemo03" aria-controls="navbarTogglerDemo03" aria-expanded="false" aria-
label="Toggle navigation">
<span class="navbar-toggler-icon" src=""><i class="fas fa-sort-down fa-3x"></i></span>
</button>
<img src="logo.png" alt="" class=" logo d-inline-block align-top">
<a href=""><i class="user-mobile align-top fas fa-user fa-2x"></i>
</a>
<div class="collapse navbar-collapse justify-content-center" id="navbarTogglerDemo03">
<ul class="navbar-nav mb-2 mb-lg-0">
<li class="nav-item">
<button class="navbtn btn btn-lg me-2" type="button">Home</button>
</li>
<li class="nav-item">
<button class="navbtn btn btn-lg me-2" type="button">Serviços</button>
</li>
<li class="nav-item">
<button class="navbtn btn btn-lg me-2" type="button">Sobre</button>
</li>
<li class="nav-item">
<button class="navbtn btn btn-lg me-2" type="button">Contato</button>
</li>
<li class="nav-item">
<button class="navbtn btn btn-lg me-2" type="button">Minha Conta</button>
</li>
</ul>
</div>
</ul>
</div>
<a href=""><i class="user-desktop align-top fas fa-user fa-2x"></i>
</nav>
<div id="top">
<div class="thumbnail">
<img class="first" src="first-img.png" alt="">
<div class="caption">
<p class="nossos">Nossos serviços são</p>
<span>inteiramente </span><span style="color:green; background-color: white;">ONLINE</span>
<p class="confira">Confira abaixo!</p>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/#popperjs/core#2.9.1/dist/umd/popper.min.js" integrity="sha384-SR1sx49pcuLnqZUnnPwx6FCym0wLsk5JZuNx2bPPENzswTNFaQU1RDvt3wT4gWFG" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.0.0-beta3/dist/js/bootstrap.min.js" integrity="sha384-j0CNLUeiqtyaRmlzUHCPZ+Gy5fQu0dQ6eZ/xAww941Ai1SxSY+0EQqNXNE6DZiVc" crossorigin="anonymous"></script>
</body>
</html>
Here is the CSS:
overflow-x: hidden;
}
/*NAV BAR ELEMENTS*/
.navbar{
background-color: white;
}
.logo{
width: 50px;
height: 44px;
}
.user-desktop{
width: 50px;
height: 44px;
position: relative;
display: inline-block;
background-color: white;
}
.user-mobile{
width: 50px;
height: 44px;
position: relative;
display: inline-block;
background-color: white;
}
.navbtn{
background-color: green;
color: white;
font-weight: 700;
padding: 4px;
margin: 3px;
}
.navbar-toggler-icon{
color: green;
position: relative;
bottom: 30px;
}
.navbar-nav{
position: absolute;
}
/*TOP*/
.first{
display: block;
width: 100%;
}
p{
margin-bottom: 0;
}
.thumbnail {
position: relative;
display: inline-block;
}
.caption {
position: absolute;
top: 56%;
left: 70%;
transform: translate( -50%, -50% );
text-align: left;
color: white;
font-family: Ubuntu-Bold;
font-style: normal;
font-weight: normal;
font-size: 5vw;
color: rgba(255,255,255,1);
white-space: nowrap;
margin-top: -5.449396133422852px;
}
.servicos-title{
font-size: 3em;
text-align: center;
}
.servicos-med{
position: absolute;
background-color: blanchedalmond;
}
#media (min-width:320px) {
.user-desktop{
display: none;
}
}
#media (min-width:481px) {
.user-desktop{
display: none;
}
}
#media (min-width:641px) {
.user-desktop{
display: none;
}
}
#media (min-width:990px) {
.user-mobile{
display: none;
}
.user-desktop{
display: inline-block;
}
}
#media (min-width:1025px) {
.user-mobile{
display: none;
}
.user-desktop{
display: inline-block;
}
}
#media (min-width:1281px) {
.user-mobile{
display: none;
}
.user-desktop{
display: inline-block;
}
}

Changing navbar background color while keeping toggle menu (hamburger)

I would like to have a custom color (#5f788a) for my navbar, however, I understand that in order to have the toggle menu in mobile version, the navbar class must be navbar-light or navbar-dark (according to Bootstrap). This, of course, overrides my custom navbar color and it looks like I have to choose between the hamburger menu OR my custom color.
Things I have tried:
1). Using ! important in CSS to override the styling;
2). Styling with the background-color attribute in CSS;
3). Styling body but this affects rest of site colors, not just navbar.
Here is the CSS:
body {
background: #fafafa;
color: #333333;
margin-top: 5rem;
}
h1, h2, h3, h4, h5, h6 {
color: #444444;
}
.bg-steel {
background-color: #5f788a;
}
.site-header .navbar-nav .nav-link {
color: #5f788a;
}
.site-header .navbar-nav .nav-link:hover {
color: #ffffff;
}
.site-header .navbar-nav .nav-link.active {
font-weight: 500;
}
.content-section {
background: #ffffff;
padding: 10px 20px;
border: 1px solid #dddddd;
border-radius: 3px;
margin-bottom: 20px;
}
.article-title {
color: #444444;
}
a.article-title:hover {
color: #428bca;
text-decoration: none;
}
.article-content {
white-space: pre-line;
}
.article-img {
height: 65px;
width: 65px;
margin-right: 16px;
}
.article-metadata {
padding-bottom: 1px;
margin-bottom: 4px;
border-bottom: 1px solid #e3e3e3
}
.article-metadata a:hover {
color: #333;
text-decoration: none;
}
#parent {
list-style: none;
width: 100%;
height: 90px;
margin: 0;
padding: 0;
white-space: nowrap;
overflow-x: auto;
overflow-y: hidden;
}
.article-svg {
width: 25px;
height: 25px;
vertical-align: middle;
}
.account-img {
height: 125px;
width: 125px;
margin-right: 20px;
margin-bottom: 16px;
}
.account-heading {
font-size: 2.5rem;
}
#import url("//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css");
And the of the site:
<body>
<header class="site-header">
<nav class="navbar navbar-default navbar-expand-md navbar-light fixed-top">
<div class="container">
<a class="navbar-brand mr-4" href="/">Company Name (v0.01)</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarToggle" aria-controls="navbarToggle" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarToggle">
<div class="navbar-nav mr-auto">
<a class="nav-item nav-link" href="/about">About</a>
</div>
<!-- SEARCH BOX-->
<!-- <form class="form-inline my-2 my-lg-0">-->
<!-- <input class="form-control mr-sm-1" id="search_box" type="search" placeholder="Find some stuff..." aria-label="Search" align="middle">-->
<!-- <button class="btn btn-outline-light my-2 my-sm-0 mr-5" type="submit" align="center">Search</button>-->
<!-- </form>-->
<!-- Navbar Right Side -->
<div class="navbar-nav">
{% if current_user.is_authenticated %}
<a class="nav-item nav-link" href="/post/new">New Post</a>
<a class="nav-item nav-link" href="/send_invites">Invite</a>
<a class="nav-item nav-link" href="/account">My Account</a>
<a class="nav-item nav-link" href="/logout"><span class="glyphicon glyphicon-log-in"></span> Logout</a>
{% else %}
<a class="nav-item nav-link" href="/login"><span class="glyphicon glyphicon-log-in"></span> Login</a>
<a class="nav-item nav-link" href="/register"><span class="glyphicon glyphicon-user"></span> Register</a>
{% endif %}
</div>
</div>
</div>
</nav>
</header>
Could it be that I should be trying to style the body? If so, wont that affect the rest of the site, not just the navbar? Thanks for your help
navbar-light and navbar-dark are helper classes, what they do is change the colour of the text from white (if navbar-dark) to black (if navbar-light), so that the text colour on your navbar doesn't conflict with the navbar colours
you can do this:
.navbar {background-color: #5f788a;}
and add the class "navbar-dark" to your nav element.
This is assuming you're using the latest version of bootstrap, 4.3
Bootstrap 4.0.0 Demo below:
body {
background: #fafafa;
color: #333333;
margin-top: 5rem;
}
h1,
h2,
h3,
h4,
h5,
h6 {
color: #444444;
}
.bg-steel {
background-color: #5f788a;
}
.site-header .navbar-nav .nav-link {
color: #5f788a;
}
.site-header .navbar-nav .nav-link:hover {
color: #ffffff;
}
.site-header .navbar-nav .nav-link.active {
font-weight: 500;
}
.content-section {
background: #ffffff;
padding: 10px 20px;
border: 1px solid #dddddd;
border-radius: 3px;
margin-bottom: 20px;
}
.article-title {
color: #444444;
}
a.article-title:hover {
color: #428bca;
text-decoration: none;
}
.article-content {
white-space: pre-line;
}
.article-img {
height: 65px;
width: 65px;
margin-right: 16px;
}
.article-metadata {
padding-bottom: 1px;
margin-bottom: 4px;
border-bottom: 1px solid #e3e3e3
}
.article-metadata a:hover {
color: #333;
text-decoration: none;
}
#parent {
list-style: none;
width: 100%;
height: 90px;
margin: 0;
padding: 0;
white-space: nowrap;
overflow-x: auto;
overflow-y: hidden;
}
.article-svg {
width: 25px;
height: 25px;
vertical-align: middle;
}
.account-img {
height: 125px;
width: 125px;
margin-right: 20px;
margin-bottom: 16px;
}
.account-heading {
font-size: 2.5rem;
}
#import url("//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css");
<!DOCTYPE html>
<!-- saved from url=(0044)https://stack.fleeksite.com/bootstrap-navbar -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>TurboTobias</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
</head>
<body>
<header class="site-header">
<nav class="navbar navbar-default navbar-expand-md navbar-dark fixed-top" style="background-color: rebeccapurple;">
<div class="container">
<a class="navbar-brand mr-4" href="https://stack.fleeksite.com/">Bench of Thoughts (v0.01)</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarToggle" aria-controls="navbarToggle" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarToggle">
<div class="navbar-nav mr-auto">
<a class="nav-item nav-link" href="https://stack.fleeksite.com/about">About</a>
</div>
<!-- Navbar Right Side -->
<div class="navbar-nav">
<a class="nav-item nav-link" href="https://stack.fleeksite.com/login"><span class="glyphicon glyphicon-log-in"></span> Login</a>
<a class="nav-item nav-link" href="https://stack.fleeksite.com/register"><span class="glyphicon glyphicon-user"></span> Register</a>
</div>
</div>
</div>
</nav>
</header>
</body>
</html>
you can just add:-
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
Instead of what you wrote earlier

Bootstrap navbar collapse opens in the wrong place

Navbar collapsed menu fits perfectly to the navbar in Safari browser and occupy full width of the viewport. However, in other browsers collapsed navbar is getting smaller and sticks to the very top of the page. Looks like it is not connected to the navbar itself and drops down from another reference point. Is this a browser prefix issue or something entirely wrong with my bootstrap structure?
.navbar {
height: 60px;
padding: 0;
margin: 0;
border-bottom: .1px solid black;
background: #ffffff;
}
.navbar-nav {
margin-top: 1.5em;
}
.navBut {
margin: 20px 0;
}
.navButBut {
border: 1px solid red;
}
.navbar-toggle {
border-color: black !important;
color: snow;
height: 30px;
width: 45px;
padding: 2px 5px 0;
margin: 15px 8% 15px 0;
}
.navbar-toggle:hover {
background-color: transparent !important;
}
.dropbut {
font-size: 1.5em;
color: black;
}
.fa-korvue {
color: #962715;
font-size: 3.5em;
line-height: -45%;
float: left;
margin: 5px 8% 0 12%;
}
.link_icon, .link_icon:link, .link_icon:visited, .link_icon:active {
color: #1e1e20;
padding: 0;
margin-right: 20px;
font-family: 'Arsenal', sans-serif;
font-size: 1.2em;
text-decoration: none;
outline: 0;
cursor: pointer;
background: transparent;
}
#collapse_menu {
margin-top: 1.2em;
}
#collapse_menu li a {
padding: 3px 8px;
margin-right: 5px;
border-radius: 3px;
}
#collapse_menu li a:hover {
background-color: rgba(0, 0, 0, 0.2) !important;
}
.hidden-xs {
margin-right: 18px;
}
#phone_handset {
color: black;
font-size: 1.7em;
vertical-align: 10%;
text-decoration: none;
outline: 0;
transition: 1s;
}
#phone_num {
display: inline;
margin-right: 4em;
vertical-align: 20%;
font-size: 1.3em;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<header>
<nav class="navbar navbar-fixed-top">
<div class="container-fluid">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="fa fa-th dropbut"></span>
</button>
<i class="fab fa-korvue"></i>
<div class="collapse navbar-collapse" id="myNavbar">
<ul id="collapse_menu" class="nav navbar-nav text-center">
<li><a class="link_icon scroll" name="1" href="#top_page_scroll">Начало</a></li>
<li><a class="link_icon scroll" name="2" href="#about_me_scroll">Обо мне</a></li>
<li><a class="link_icon scroll" name="3" href="#portfolio_scroll">Услуги</a></li>
<li><a class="link_icon scroll" name="4" href="#pricing_scroll">Цены</a></li>
<li><a class="link_icon scroll" name="5" href="#contact_me_scroll">Регистрация</a></li>
</ul>
<div class="navbar-nav navbar-right vertical-align">
<a id="phone_handset" class="fas fa-phone-volume hidden-xs" href="#"></a>
<a id="phone_num" class="link_icon hidden-xs" href="#">110-223-456-78</a>
</div>
</div>
</div>
</nav>
</header>
I finally fixed this issue. If you wrap navbar-toggle with <div class=“navbar-header”> then everything starts to work as expected. Now collapsed navbar occupies full width and sits in the right place. Thank #fnostro for the valuable tips.
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<header>
<nav class="navbar navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="fa fa-th dropbut"></span>
</button>
<i class="fab fa-korvue"></i>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul id="collapse_menu" class="nav navbar-nav text-center">
<li><a class="link_icon scroll" name="1" href="#top_page_scroll">Начало</a></li>
<li><a class="link_icon scroll" name="2" href="#about_me_scroll">Обо мне</a></li>
<li><a class="link_icon scroll" name="3" href="#portfolio_scroll">Услуги</a></li>
<li><a class="link_icon scroll" name="4" href="#pricing_scroll">Цены</a></li>
<li><a class="link_icon scroll" name="5" href="#contact_me_scroll">Регистрация</a></li>
</ul>
<div class="navbar-nav navbar-right vertical-align">
<a id="phone_handset" class="fas fa-phone-volume hidden-xs" href="#"></a>
<a id="phone_num" class="link_icon hidden-xs" href="#">110-223-456-78</a>
</div>
</div>
</div>
</nav>
</header>

Changing the position of icons, so they appear in-line and not below each other

I am having an issue with my navbar, which consists of 4 icons and a search bar. I want the search icon to appear after the search bar, but at the moment it is forced below onto a new line and i'm not sure why.
Website: explorecanterbury.co.uk
HTML/CSS:
.form-control {
width:230px;
margin-top: 7px;
}
.navbar{
max-width: 415px;
margin-top: 20px;
}
#media (max-width: 767px) {
.navbar{
width: 75px;
}
}
.navbar-collapse{
padding-right: 0px;
padding-left: 0px;
}
.nav > li {
padding: 5px;
margin-top:8px;
padding-left: 10px;
padding-right: 10px;
border-right: 1px solid rgba(255, 150, 0, 0.15);
}
.nav > li:last {
border-right: none;
}
.navbar-default {
background-color: #fff;
border-color: rgba(255, 150, 0, 0.15);
}
.nav-toggle-2 {
width: 24px;
height: 24px;
display: block;
}
.nav-toggle-3 {
width: 24px;
height: 24px;
display: block;
}
.LocIcon {
background-image:url(/images/select.png);
width:24px;
height:24px;
display: block;
}
.photosIcon {
background-image:url(/images/photos.png);
width:24px;
height:24px;
display: block;
}
.infoIcon {
background-image:url(/images/information.png);
width:24px;
height:24px;
display: block;
}
.searchIcon {
background-image:url(/images/search.png);
width:24px;
height:24px;
display: block;
}
<nav class="navbar navbar-default" style="z-index:5;">
<!-- 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>
</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 type="button" class="btn btn-default dropdown-toggle hidden-xs" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span class="LocIcon"></span></li>
<ul class="dropdown-menu">
<li><a id="mgtoggle" class="small toggle" data-value="option2" tabIndex="-1"><input type="checkbox"/> Museums and Galleries</a></li>
<li><a id="landmarktoggle" class="small toggle" data-value="option3" tabIndex="-1"><input type="checkbox"/> Landmarks</a></li>
<li><a id="shoppingtoggle" class="small toggle" data-value="option4" tabIndex="-1"><input type="checkbox"/> Shopping</a></li>
<li><a id="hotelstoggle" class="small toggle" data-value="option5" tabIndex="-1"><input type="checkbox"/> Hotels + Bed & Breakfast</a></li>
<li><a id="churchestoggle" class="small toggle" data-value="option6" tabIndex="-1"><input type="checkbox"/> Churches</a></li>
<li><a id="tourstoggle" class="small toggle" data-value="option7" tabIndex="-1"><input type="checkbox"/> Tours and Guides</a></li>
</ul>
<li><span class="photosIcon nav-toggle-2 hidden-xs"></span></li>
<li><span class="infoIcon nav-toggle-3 hidden-xs"></span></li>
</ul>
<div class="searchBar">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search" id="srch-term">
</div>
<span class="searchIcon hidden-xs"></span>
</div>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
I messed around on your site with an inspector and this is what I came up with:
.input-group {
position: relative;
display: inline-block;
border-collapse: separate;
width: 65%;
}
.input-group .form-control {
position: relative;
z-index: 2;
float: left;
width: 80%;
margin-bottom: 0;
}
.searchIcon {
background-image: url(/images/search.png);
width: 24px;
height: 24px;
margin: 12px 5px;
display: inline-block;
float: left;
}
<div class="input-group">
<input type="text" class="form-control ui-autocomplete-input" placeholder="Search" id="srch-term" autocomplete="off">
<span role="status" aria-live="polite" class="ui-helper-hidden-accessible"></span>
<span class="searchIcon hidden-xs"></span>
</div>
Picture of how it looks here: Explorecanterbury Photo
Let me know how it works out.

Responsive bootstrap nav with brand

I'm having trouble keeping my navbar responsive. When the browser reaches a certain size, the height will increase. I made a fiddle to show what is happening, if you expand the preview, the navbar will be normal.
http://jsfiddle.net/x70r23cn/
.navbar {
background-color: #204489;
box-shadow: 0 4px 8px rgba(0,0,0,.25);
float: center;
}
.navbar a {
color: #fff;
}
.navbar-brand img {
margin-left: auto;
margin-right: auto;
height: 25px;
}
.navbar-brand {
margin-left: auto !important;
margin-right: auto !important;
display: block !important;
float: none !important;
}
<nav class='navbar navbar-fixed-top'>
<div class='container'>
<div class='navbar-header'>
<button aria-controls='navbar' aria-expanded='false' class='navbar-toggle collapsed' data-target='#navbar' 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>
<div class='navbar-brand'>
<img src="https://placeholdit.imgix.net/~text?txtsize=33&txt=350%C3%97150&w=271&h=25" />
</div>
</div>
</nav>
Remove the navbar-header class as it's designed to enable the collapse menu on mobile devices; that's why the navbar is expanding.
See example Snippet.
.navbar.navbar-custom {
background-color: #204489;
box-shadow: 0 4px 8px rgba(0, 0, 0, .25);
float: center;
}
.navbar.navbar-custom a {
color: #fff;
}
.navbar.navbar-custom .navbar-brand {
margin-left: auto;
margin-right: auto;
display: block;
float: none;
}
.navbar.navbar-custom .navbar-brand img {
margin-left: auto;
margin-right: auto;
height: 25px;
margin-top: -2px;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />
<nav class='navbar navbar-custom navbar-fixed-top'>
<div class='container'>
<div class='navbar-brand'>
<img src="https://placeholdit.imgix.net/~text?txtsize=33&txt=350%C3%97150&w=271&h=25" />
</div>
</div>
</nav>
try this... the navbar-brand needs to be in the navbar-header and the navbar-brand needs to be inline or inline-block.
.navbar {
background-color: #204489;
box-shadow: 0 4px 8px rgba(0,0,0,.25);
float: center;
}
.navbar a {
color: #fff;
}
.navbar-brand img {
margin-left: auto;
margin-right: auto;
height: 25px;
}
.navbar-brand {
margin-left: auto !important;
margin-right: auto !important;
display: block !important;
float: none !important;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<nav class="navbar navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button aria-controls="navbar" aria-expanded="false" class="navbar-toggle collapsed" data-target="#navbar" 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>
<a class="navbar-brand">
<img src="https://placeholdit.imgix.net/~text?txtsize=33&txt=350%C3%97150&w=271&h=25" />
</a>
</div>
</div>
<nav>