Reputation: 1997
Take a look at the below example.
I want the <a>
tag to be besides Button 2
.
Upvotes: 5
Views: 11826
Reputation: 193261
Bootstrap uses 12 column grid. Right now two buttons take the whole available space (both 6-column width) leaving no space for the third. You can layout your buttons as 5+5+2 columns. For example:
<div class="col-md-6 col-md-offset-2">
<button type="submit" class="btn btn-default btn-md col-md-5">Button 1</button>
<button type="reset" class="btn btn-default btn-md col-md-5">Button 2</button>
<a href="#" class="btn btn-default btn-md col-md-2"><span class="glyphicon glyphicon-search"></span></a>
</div>
You want to place the third button outside the row container, you can position it absolutely relatively to the col group:
<a href="#" class="btn btn-default btn-beside"><span class="glyphicon glyphicon-search"></span></a>
CSS:
.btn-beside {
position: absolute;
left: 100%;
top: 0;
margin-left: -10px;
}
Upvotes: 5