This is only the second time I've used stackoverflow so please forgive me if I make any mistakes.
I'm having an issue increasing the width of the default Bootstrap navbar search form. I have tried some of the solutions I've seen on stackoverflow, however nothing seems to work.
Please see: http://jsfiddle.net/94zkLh8j/1/
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" class="read-more" 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" href="#">Vouchipster</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<form class="navbar-form navbar-right" role="search">
<div class="form-group">
<div style="display:table;" class="input-group">
<input type="text" class="form-control" placeholder="Search for retailers, categories or products">
<span class="input-group-btn">
<button class="btn btn-green" type="button"><i class="fa fa-search"></i></button>
</span>
</div>
</div>
</form>
</div>
</div>
</nav>
Go to Customizer > Layout > Primary Navigation and increase the Menu Item Height as this sets the size of the logo.
In Bootstrap 4, full width dropdown in Navbar might be possible by adding CSS properties either internally or externally based on conveniences. Focus on class dropdown and dropdown-menu only. Now, make top margin of dropdown-menu as zero pixel and add width to 100%. We can also use CSS properties through inline method.
With Bootstrap, a navigation bar can extend or collapse, depending on the screen size. A standard navigation bar is created with the .navbar class, followed by a responsive collapsing class: .navbar-expand-xl|lg|md|sm (stacks the navbar vertically on extra large, large, medium or small screens).
You can set the width of the input
element in your document stylesheet. Use !important
to override any bootstrap widths. I recommend adding an id to the form for easy selection in css
Updated Fiddle
HTML
...
<form class="navbar-form navbar-right" role="search" id="navBarSearchForm">
...
CSS
<style>
#navBarSearchForm input[type=text]{width:430px !important;}
</style>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With