I have three columns displayed in one row, I need to align last two to the right corner, it works fine with one column but when I try to pull-right two it messes up grid and pushes elements to the next row down. The question is how to align one column to the right and other next to it.
<div class="row ">
<div class="col-sm-4">
...
</div>
<div class="col-sm-3" >
...
</div>
<div class="col-sm-5 pull-right">
<div class=" pull-right">
...
</div>
</div>
</div>
Current:
|[ ] [ ] [ ]|
Wanted:
|[ ] [ ][ ]|
HTML | <col> align Attribute left: It sets the text left-align. right: It sets the text right-align. center: It sets the text center-align.
To horizontally align columns, we can use the justify-content classes. justify-content-start left align the columns. justify-content-center center aligns the columns. justify-content-end right align the columns.
Offset classes Move columns to the right using .offset-md-* classes. These classes increase the left margin of a column by * columns. For example, .offset-md-4 moves .col-md-4 over four columns.
It depends on whether you're right aligning text inside the middle column, or some another container inside the column.. Here are a few examples that may work for you..
http://www.bootply.com/119747
<div class="row ">
<div class="col-sm-4">
1 text here
</div>
<div class="col-sm-3 text-right">
2 text here
</div>
<div class="col-sm-5">
3 text here
</div>
</div>
<div class="row ">
<div class="col-sm-4">
<div class="well">
content
</div>
</div>
<div class="col-sm-3">
<div class="well pull-right">
content pull-right
</div>
</div>
<div class="col-sm-5">
<div class="well">
content
</div>
</div>
</div>
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