There are three content blocks and I'd like to enable/disable them with the Bootstrap's data-* "tools". The control elements should be checkboxes. When a content block is displayed, its checkbox should be checked.
summary
The problem is, that the checkbox inside links are not working as expected (starting to change the state only after the second click), after adding the Bootstrap behavior to the wrapping a tags.
The code is here.
long version
So first of all I created the content blocks and the controls without functionality (and gave them some styles):
<div class="col-xs-12" id="select-panel">
<div class="col-lg-12" id="filter-bar">
<div>
<a href="#containerFoo">
<label class="btn btn-primary" id="filterFoo">
<input type="checkbox" checked autocomplete="off">
<span class="text-label">foo</span>
<span class="glyphicon glyphicon-question-sign"></span>
</label>
</a>
<a href="#containerBar">
<label class="btn btn-primary" id="filterBar">
<input type="checkbox" checked autocomplete="off">
<span class="text-label">bar</span>
<span class="glyphicon glyphicon-ok-sign"></span>
</label>
</a>
<a href="#containerBuz">
<label class="btn btn-primary" id="filterBuz">
<input type="checkbox" checked autocomplete="off">
<span class="text-label">buz</span>
<span class="glyphicon glyphicon-remove-sign"></span>
</label>
</a>
</div>
</div>
</div>
<div> </div>
<div class="panel panel-default in" id="containerFoo">foo</div>
<div class="panel panel-default in" id="containerBar">bar</div>
<div class="panel panel-default in" id="containerBuz">buz</div>
The checkboxes are behaving as expected. Now the actual functionality needs to be added. The the A tags were extended as follows:
...
<a href="#containerFoo" data-toggle="collapse" aria-expanded="true" aria-controls="containerFoo">
...
</a>
<a href="#containerBar" data-toggle="collapse" aria-expanded="true" aria-controls="containerBar">
...
</a>
<a href="#containerBuz" data-toggle="collapse" aria-expanded="true" aria-controls="containerBuz">
...
</a>
...
Now the toggling is working. But the checkboxes are always checked. Well, after it I also extended the DIV wrapper around the control checkboxes:
<div class="btn-group" data-toggle="buttons">
Now the checkboxes are behaving ever stranger. On the first click the checkbox remains on (checked). An from the second click on the same checkbox the behavior becomes normal: the state gets changed on every click.
Is it a bug or am I doing something wrong?
How to get checkboxes inside links working correctly, when Bootstrap toggling is used?
I would keep the link and drop the form elements.
the checkbox can be drawn from a pseudo holding a checkmark or not.
here is the basic idea : https://jsfiddle.net/jsL3dx1w/7/
#filter-bar {
margin: 0;
padding: 0;
white-space: nowrap;
text-align: right;
}
#filter-bar * {
box-sizing: border-box;
}
#filter-bar a,
#filter-bar a:hover {
text-decoration: none;
}
a[data-toggle]:before {
display:inline-block;
content:'\2713';
border:solid 1px white;
box-shadow:inset 0 0 2px black, 0 0 1px black;
line-height:0.6em;
color:darkblue;
width:0.8em;height:0.8em;
}
a[data-toggle].collapsed:before {content:''}
#filter-bar {
outline: none;
border: 0;
color: #ffffff;
}
#filter-bar span{
margin: 5px 5px 0 5px;
outline: 0;
}
#filter-bar .btn:active,
#filter-bar .btn.active {
outline: 0;
-webkit-box-shadow: none;
box-shadow: none;
}
#containerFoo,
#filter-bar #filterFoo {
background: #f5a623;
}
#containerBar,
#filter-bar #filterBar {
background: #50c14e;
}
#containerBuz,
#filter-bar #filterBuz {
background: #d21f31;
}
.clear {
float: none;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="https://code.jquery.com/jquery-latest.min.js"></script>
<link href="https://cdn.rawgit.com/twbs/bootstrap/v3.3.7/dist/css/bootstrap.css" rel="stylesheet"/>
<div class="col-xs-12" id="select-panel">
<div class="col-lg-12" id="filter-bar">
<div class="btn-group" data-toggle="buttons">
<a href="#containerFoo" data-toggle="collapse" aria-expanded="true" aria-controls="containerFoo"class="btn btn-primary" id="filterFoo">
<span class="text-label">foo</span>
<span class="glyphicon glyphicon-question-sign"></span>
</a>
<a href="#containerBar" data-toggle="collapse" aria-expanded="true" aria-controls="containerBar" class="btn btn-primary" id="filterBar">
<span class="text-label">bar</span>
<span class="glyphicon glyphicon-ok-sign"></span>
</a>
<a href="#containerBuz" data-toggle="collapse" aria-expanded="true" aria-controls="containerBuz" class="btn btn-primary" id="filterBuz">
<span class="text-label">buz</span>
<span class="glyphicon glyphicon-remove-sign"></span>
</a>
</div>
</div>
</div>
<div> </div>
<div class="panel panel-default in" id="containerFoo">
foo
</div>
<div class="panel panel-default in" id="containerBar">
bar
</div>
<div class="panel panel-default in" id="containerBuz">
buz
</div>
automatix wrote
I took your solution and edited it a bit. The principle is still the same, but implemented with glyphicons: http://jsfiddle.net/automatix/jsL3dx1w/41 .
Related
I have a dropdown in card header i need that to be in top right corner how do i set that in my header.I need welcome message in right side of the card header as below image its beside the title
What I did:-
I added a classes to .card (of bootstrap) with CSS properties of display: "flex" justify-content: "space-between" and flex-direction: row
reference:- https://getbootstrap.com/docs/4.0/utilities/flex/
Style:-
<style>
.card {
/* Add shadows to create the "card" effect */
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
transition: 0.3s;
margin: 0 auto;
float: none;
margin-bottom: 10px;
}
/* On mouse-over, add a deeper shadow */
.card:hover {
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
}
body {
background-color: lightblue;
}
</style>
Html:-
<div class="container-fluid" style="padding-top: 50px">
<div class="card d-flex flex-row justify-content-between">
<div
class="card-header text-center"
style="font-family: Sans-Serif; text-transform: uppercase; font-size: 1.5rem"
>
Project Manager Dashboard
</div>
<div class="btn-group dropleft">
<button
type="button"
class="btn btn-outline-secondary"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
>
Hi, Drake
</button>
<div class="dropdown-menu">
<!-- Dropdown menu links -->
<a href="{% url 'logout_view' %}"
><button class="dropdown-item" type="button">Logout</button></a
>
</div>
</div>
</div>
</div>
snip
To set it in the top-right corner just use the align property this would align the element to the right.
<div class="container-fluid" style="padding-top: 50px;">
<div class="card">
<div class="card-header text-center " style="font-family: Sans-Serif; text-transform:uppercase; font-size:1.5rem">
Project Manager Dashboard
<div class="btn-group dropright" align="right" >
<!-- Dropdown menu links -->
<button class="dropdown-item" type="button">Log</button>
</div>
<div class="btn-group dropleft">
<button type="button" class="btn btn-outline-secondary" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Hi, Drake
</button>
</div>
</div>
I have a question regarding the vertical alignment of a button group within a row, using bootstrap.
This is an image that explains what I'm trying to achieve
And the following code is used in my current project:
body {
padding-top: 50px;
padding-bottom: 20px;
}
/* Set padding to keep content from hitting the edges */
.body-content {
padding-left: 15px;
padding-right: 15px;
}
/* Override the default bootstrap behavior where horizontal description lists
will truncate terms that are too long to fit in the left column
*/
.dl-horizontal dt {
white-space: normal;
}
/* Set width on the form input elements since they're 100% wide by default */
input,
select,
textarea {
max-width: 280px;
}
<div class="row">
<div class="col-sm-9">
#if (item.Completed) {
<h4><span class="label label-success">Completed</span> #item.Procedure.Title</h4>
} else {
<h4><span class="label label-danger">Not completed</span> #item.Procedure.Title</h4>
}
<div class="row">
<div class="col-sm-6">
<dl class="dl-horizontal">
<dt>Time required:</dt>
<dd>#item.Procedure.Time</dd>
<dt>Material required:</dt>
<dd>#item.Procedure.Material</dd>
<dt>Engineers required:</dt>
<dd>#item.Procedure.Engineers</dd>
<dt>Documentation:</dt>
<dd>#item.Procedure.Documents</dd>
</dl>
</div>
<div class="col-sm-6">
<dl class="dl-horizontal">
<dt>Status:</dt>
<dd>#item.Status</dd>
<dt>Note:</dt>
<dd>#item.Note</dd>
</dl>
</div>
</div>
</div>
<div class="col-sm-3" style="vertical-align: middle;">
<div class="btn-group" role="group" aria-label="...">
<button type="button" class="btn btn-success" role="group">
<span class="glyphicon glyphicon-ok"></span>
OK
</button>
<button type="button" class="btn btn-danger" role="group">
<span class="glyphicon glyphicon-remove"></span>
Not OK
</button>
<button type="button" class="btn btn-info" role="group" data-toggle="modal" data-target="#noteModal#(item.ID)">
<span class="glyphicon glyphicon-pencil"></span>
Add note
</button>
</div>
<div id="noteModal#(item.ID)" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Add note</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="form-group">
<label for="note">Note:</label>
<textarea class="form-control" rows="5" id="note" style="min-width: 100%;"></textarea>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary">Add note</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
</div>
Any help apreciated, thanks!
I solved the problem using the flex property on the outer .row
.row-flex {
display: flex;
align-items: center;
}
Image
This is what I did:
.btn-group {
flex-wrap: wrap;
width: 80px;
}
button{
width:80px;
}
Here is the JSFiddle demo
With the following code, on a "middle screen", the result is OK.
But on a small screen (smartphones), it is not.
I wish the input and the submit button (magnifying glass) are aligned on the same line.
How I can do that?
<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" data-target="#navbar" aria-controls="navbar">
<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="#">Diko Responsive</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<form class="navbar-form navbar-right" action="index.php" method="get">
<div class="form-group" >
<input id="terme" name="terme" placeholder="Veuillez saisir un terme" class="form-control input-xs" type="search">
<button type="submit" class="btn btn-info"><span class="glyphicon glyphicon-search"></span></button>
</div>
</form>
</div>
</div>
</nav>
Thanks.
EDIT: I added this CSS file after the advices of #NiklasMH
#media (max-width : 768px){
.form-group input {
width: calc(70% - 32.5px);
}
.form-group button {
width: 40px;
}
}
But as you can see, both are still not aligned.
You almost there. You only forgot to call class=input-group
You no need to add another media queries there.
HTML
<div class="input-group">
<input id="terme" name="terme" placeholder="Veuillez saisir un terme" class="form-control input-xs" type="search">
<span class="input-group-btn">
<button class="btn btn-info" type="button"><span class="glyphicon glyphicon-search"></span></button>
</span>
</div>
Here is the DEMO
I don't know the twitter-bootstrap that good, so this answer is more about what you can do to the CSS.
Bad practice
Some say it's bad practice, but you could eigther use a table to align them on the same row. Then you also can make the left or right column in fixed width like:
td:last-child {
width: 32px;
}
Good practice
Or you can use the calc-value in CSS, which is widly supported now (except in Opera Mini - ref caniuse.com), like:
.form-group input {
width: calc(100% - 44px); /* Minus a little more (4px) than the button-width */
}
.form-group button {
width: 40px;
}
Remember that padding will make the element bigger and force more space, so set box-sizing to border-box (default content-box) to avoid this:
.form-group input, .form-group button {
box-sizing: border-box;
}
JSFIDDLE
.form-group input, .form-group button {
box-sizing: border-box;
}
.form-group input {
width: calc(100% - 44px);
max-width: 160px;
}
.form-group button {
width: 40px;
}
<div class="form-group">
<input placeholder="text"/>
<button>btn</button>
</div>
Currently working on my navbar and would like to have the width of the search bar wider so the navbar does not look too segmented. I've played around with the width on CSS and haven't had any luck. I've also looked at similar questions on this site but have not found the solution. Please see my code below.
<nav id="mainNav" class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<!-- 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">
<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 page-scroll" href="#page-top">HELLO</a>
</div>
<!-- SEARCH FORM -->
<form id="navsearch" class="navbar-form pull-right" role="search" action="" method="post">
<div class="input-group" display="inline">
<input name="search" type="text" class="form-control" placeholder="Search">
<span class="input-group-btn">
<button class="btn btn-default btn" name="submit" class="btn btn-lg" type="submit">
<span class="glyphicon glyphicon-search" ></span>
</button>
</div>
</form>
<!--Button to Upload Information -->
<div class="container text-center">
<div class="call-to-action">
Upload Your Story
<div class="modal fade" id="myModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Submit</h4>
</div><!-- end modal-header -->
<div class="modal-body">
<h4></h4>
<p><small class="text-muted">Tell us</small></p>
<form action="forms.php" method="post" class="form-horizontal">
<div class="form-group">
<label class="col-lg-2 control-label" name="name" >Name</label>
<div class="col-lg-10">
<input class="form-control" name="name" placeholder="Name" type="text">
</div>
</div>
<div class="form-group" method="post">
<label class="col-lg-2 control-label" name="yourStory">Your Tell All</label>
<div class="col-lg-10">
<textarea class="form-control" name="yourStory" placeholder="Tell us your story" rows="3"></textarea>
</div>
<div class="form-group">
<label class="col-lg-2" for="inputFile">File input</label>
<input type="file" name="inputfile" id="inputFile">
</div>
<br>
<div class="form-group">
<div class="col-lg-10">
<button name="submit" class="btn btn-success active" type="submit">Submit</button>
</div>
</div>
</form>
</div><!-- end modal-body -->
<div class="modal-footer">
<button class="btn btn-default" data-dismiss="modal" type="button">Close</button> <button class="btn btn-primary" type="button">Save changes</button>
</div><!-- end modal-footer -->
</div><!-- end modal-content -->
</div><!-- end modal-dialog -->
</div><!-- end myModal -->
<!-- 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 navbar-right">
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
CSS
/* --------------------------------------
Navbar
-------------------------------------- */
.navbar-default {
border-color: rgba(255,255,255, 0.7);
font-family: 'Open Sans','Helvetica Neue',Arial,sans-serif;
background-color: rgba(255,255,255, 0.7);;
-webkit-transition: all .5s;
-moz-transition: all .5s;
transition: all .5s;
}
#searchInput {
width: 200px;
}
.navbar-brand {
padding: 13px 15px;
}
#mainNav{
padding-top: 10px;
padding-left: 20px;
}
#search{
width: 500px;
This may help as it's an alternate way of setting up your navbar so you can adjust your search input to whatever makes sense and use media queries with it.
*I also adjusted your modal because it was in the from place and had some errors in it etc. See working example.
body,
html {
margin-top: 60px;
}
.navbar.navbar-custom {
border: none;
background: white;
-webkit-box-shadow: 5px 5px 5px 0px rgba(50, 50, 50, 0.15);
-moz-box-shadow: 5px 5px 5px 0px rgba(50, 50, 50, 0.15);
box-shadow: 5px 5px 5px 0px rgba(50, 50, 50, 0.15);
}
.navbar.navbar-custom .form-search {
right: 0;
top: 0px;
position: fixed;
margin: 0;
border: none;
}
.navbar.navbar-custom .form-search .search-box {
height: 50px;
border-radius: 0;
border: none;
width: 700px;
box-shadow: none;
outline: none;
}
.navbar.navbar-custom .btn.btn-search {
height: 50px;
border-radius: 0;
border: none;
background: grey;
color: white;
}
.navbar.navbar-custom .btn.btn-upload {
float: 0;
height: 50px;
border-radius: 0;
border: none;
background: #a94442;
color: white;
}
.navbar.navbar-custom .navbar-header .navbar-toggle,
.navbar.navbar-custom .navbar-header .navbar-toggle:hover,
.navbar.navbar-custom .navbar-header .navbar-toggle:focus {
background: none;
border: none;
}
.navbar.navbar-custom .navbar-header span.icon-bar {
background: #444;
}
#media (min-width: 768px) {
.navbar.navbar-custom {
height: 50px;
}
}
#media (max-width: 992px) {
.navbar.navbar-custom .form-search .search-box {
width: 500px;
}
}
#media (max-width: 767px) {
.navbar.navbar-custom .form-search {
right: 70px;
}
.navbar.navbar-custom .form-search .search-box {
width: 225px;
}
}
#media (max-width: 480px) {
.navbar.navbar-custom .navbar-brand {
display: none;
}
.navbar.navbar-custom .form-search .search-box {
width: 70%;
}
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" rel="stylesheet" />
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-nav" 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> <a class="navbar-brand" href="#">HELLO</a>
</div>
<div class="collapse navbar-collapse" id="bs-nav">
<ul class="nav navbar-nav">
<li>Home
</li>
</ul>
</div>
</div>
<form class="form-search">
<div class="input-group"> <span class="input-group"> <span class="input-group-btn" role="group" aria-label="...">
<button type="button" href="#myModal" data-toggle="modal" class="btn btn-upload">Upload</button>
</span>
<input type="text" class="form-control search-box" placeholder="Search"> <span class="input-group-btn" role="group" aria-label="...">
<button type="button" class="btn btn-search"><i class="fa fa-search"></i></button>
</span> </span>
</div>
</form>
</nav>
<div class="modal fade" id="myModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Submit</h4>
</div>
<!-- end modal-header -->
<div class="modal-body"> <small class="text-muted">Tell us</small>
<form action="forms.php" method="post" class="form-horizontal">
<label for="name" name="name">Name</label>
<input class="form-control" name="name" placeholder="Name" type="text">
<br>
<label for="yourStory" name="yourStory">Your Tell All</label>
<textarea class="form-control" name="yourStory" placeholder="Tell us your story" rows="3"></textarea>
<br>
<label for="inputFile">File input</label>
<input type="file" name="inputfile" id="inputFile">
<br>
<button name="submit" class="btn btn-success active" type="submit">Submit</button>
</form>
</div>
<div class="modal-footer">
<button class="btn btn-default" data-dismiss="modal" type="button">Close</button>
<button class="btn btn-primary" type="button">Save changes</button>
</div>
</div>
</div>
</div>
<!-- end myModal -->
<div class="container">
<div class="alert alert-info">Yo</div>
</div>
I'm trying to solve the various issues with Bootstrap input-group placed inside navbar. The formatting http://bootply.com/101777
<div class="container">
<nav class="navbar navbar-default" role="navigation">
<div class="navbar-header">
<span class="navbar-brand">Game</span>
</div>
<form class="navbar-form navbar-left itg-game">
<div class="form-group itg-first">
<div class="input-group">
<span class="input-group-addon" ng-bind="first.name"></span>
<input type="text" class="form-control" readonly ng-model="first.value">
</div>
</div>
<div class="form-group">
<div class="btn-group itg-action">
<button ng-click="swap()" class="btn btn-default itg-action-btn" ng-bind="text"></button>
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu" role="menu">
<li><a href ng-click="resetGame()">Reset game</a></li>
</ul>
</div>
</div>
<div class="form-group itg-second">
<div class="input-group">
<input type="text" class="form-control" readonly ng-model="second.value">
<span class="input-group-addon" ng-bind="second.name"></span>
</div>
</div>
<div class="form-group itg-fee">
<div class="input-group">
<input type="text" class="form-control" readonly ng-model="fee">
<span class="input-group-addon">fee</span>
</div>
</div>
</form>
</nav>
</div>
And the styles:
#media (min-width: 768px) {
.itg-game { }
.itg-game .itg-first, .itg-game .itg-second { width: 12em; }
.itg-game .itg-fee { width: 8em; }
.itg-game .itg-action { text-align: center; }
.itg-game .itg-action .itg-action-btn { width: 15em; }
}
There are two issues:
The mobile view (less than 768px) is completely rubbish - lines overlaps the borders of the navbar, controls stick to the borders.
mid-size version is better but for some reason the third input jumps to the third line.
It looks like the input-groups are not compatible with navbars. Am I right?
They work fine with the navbar with a minimal amount of fiddling with the css, but you can't have it set up like you have it because the size matters. Input groups are display:table and 100% width, they need a col-. If you had too many links or links with really long names, your navbar would break down crappily.
DEMO http://jsbin.com/putuki/1/edit
<div class="navbar navbar-default navbar-static-top my-navbar">
<button class="navbar-toggle visible-xs" data-target=".navbar-collapse" data-toggle="collapse" type="button"><span class="sr-only">Toggle navigation</span> <span class="icon-bar"><!--empty--></span> <span class="icon-bar"><!--empty--></span> <span class="icon-bar"><!--empty--></span></button>
<div class="container visible-xs">
<a class="navbar-brand" href="#">Project name</a>
</div>
<div class="navbar-collapse collapse" id="mynavcollapse">
<div class="container">
<div class="row">
<form>
<div class="col-sm-2 hidden-xs">
<a class="navbar-brand" href="#">Project name</a>
</div>
<div class="col-sm-2">
<div class="input-group">
<input class='form-control' placeholder="Search: (stuff)" type='text'> <span class="input-group-btn"><button class="btn btn-default">Button</button></span>
</div><!-- /input-group -->
</div><!-- /col- -->
<div class="col-sm-2">
<div class="input-group">
<input class='form-control' placeholder="Search: (stuff)" type='text'> <span class="input-group-btn"><button class="btn btn-default">Button</button></span>
</div><!-- /input-group -->
</div><!-- /col- -->
<div class="col-sm-3">
<div class="input-group">
<input class='form-control' placeholder="Search: (stuff)" type='text'> <span class="input-group-btn"><button class="btn btn-default">Button</button></span>
</div><!-- /input-group -->
</div><!-- /col- -->
<div class="col-sm-3">
<div class="input-group">
<input class='form-control' placeholder="Search: (stuff)" type='text'> <span class="input-group-btn"><button class="btn btn-default">Button</button></span>
</div><!-- /input-group -->
</div><!-- /col- -->
</form>
</div>
</div>
</div>
</div>
CSS
.my-navbar .row [class*="col-"] {
margin-top: 10px
}
#mynavcollapse {
clear: both;
padding: 0 0 10px;
background: #eee;
}
#media (min-width: 768px) {
.my-navbar .navbar-brand {
float: none;
display: inline-block;
padding: 7px 0 0 0;
}
.my-navbar .row {
margin-left: -.5%;
margin-right: -.5%;
}
.my-navbar .row [class*="col-"] {
min-height: 1px;
padding-left: .5%;
padding-right: .5%;
padding-top: 10px;
margin-top: 0;
}
}