I am trying to have a row across my screen, with Login information on the left, and then some other info on the far right, right justified. This is my unsuccessful attempt:
<div class="container well"> <div class="row"> <div class="col-lg-6"> @(Session["CurrentUserDisplay"] != null ? "Welcome, " + @Session["CurrentUserDisplay"] : "Not logged in") </div> <div class="col-lg-6 pull-right">Active Portfolio: @(Session["ActivePortfolioName"].ToString()) </div> </div> </div>
But the 2nd column is sitting in the middle of the row, so seems it's not right justified in the 'cell'. Can anyone guide me to get this right?
To move columns to the right, use the . col-*-offset-* class in Bootstrap.
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.
You can simply use the class . justify-content-between in combination with the class . d-flex to left align and right align text content within a <div> container in Bootstrap 4.
Instead of pull-right use text-right.
text-right
class aligns the content of that element to right by using text-align: right
.
pull-right
class aligns the element itself by using float:right
.
I think you need to use offset. Add the class col-md-offset-*
You can read more in doc: http://getbootstrap.com/css/#grid-offsetting
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