I'm trying to align a button in a simple form..
I did this:
<div class="panel panel-default">
<div class="panel-heading">teste</div>
<div class="panel-body">
<div class="row">
<div class="col-lg-6" style="padding-right:20px; border-right: 1px solid #ccc;">
<label class="form-control"> Teste</label>
<input type="button" class="form-control btn-danger" value="example" /><br/>
<input type="button" class="form-control btn-danger" value="example" /><br/>
<input type="button" class="form-control btn-danger" value="example" /><br/>
<input type="button" class="form-control btn-danger" value="example" /><br/>
</div>
<div class="col-lg-6" style="margin:0 auto;" >
<input type="button" value="botão" />
</div>
</div>
</div>
</div>
but I want this button to be centered as shown in the following image:
how can i do that? i used "style="margin:0 auto;" on div but didn't work..
I've made you an example of a possible solution. It may need some extra work but it shows the general idea.
jsFiddle Demo
I've added a new class called vertical-container for this demo.
.vertical-container .row {
display: table;
width: 100%;
}
.vertical-container .row > .col-lg-6 {
display: table-cell;
vertical-align: middle;
/* float: none; ~~~~~ Use this setting if needed */
}
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