FrankO FrankO - 23 days ago 13
CSS Question

Bootstrap alignment of label and regular text

I have been trying to get the text to properly align vertically with no luck. Could I get some assistance?

Alignment Problem

Here is the underlying code:

<div class="form-group">
<label class="control-label col-md-2">Permalink</label>
<div class="col-md-10">
http://www.somedomain.com/cart/@Model.Offer.Id
</div>
</div>

<div class="form-group">
@Html.LabelFor(model => model.Offer.DateCreated, new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.DisplayFor(model => model.Offer.DateCreated)
@Html.ValidationMessageFor(model => model.Offer.DateCreated)
</div>
</div>

Answer

Per Bootstrap docs, you can use <p class="form-control-static">email@example.com</p> to properly align static text in form groups.