Scuba Steve
Scuba Steve

Reputation: 1648

Aligning text in asp.net mvc

So I have some text, an Html.LabelFor on the left, and some raw text (as @Html.DisplayText simply does not work).

enter image description here

I end up with the above awfulness. I've tried to set the div alignment explicitly, to no avail. What am I missing here?

<div class="form-group" style="align-items:center">
        @Html.LabelFor(model => model.seniority, htmlAttributes: new { @class = "control-label col-md-2" })
            @Model.seniority.ToString()

    </div>

Upvotes: 0

Views: 2966

Answers (1)

Mir Gulam Sarwar
Mir Gulam Sarwar

Reputation: 2648

Here is the approach you should use when using bootstrap

 <div class="form-group" style="align-items:center">
    <div class="col-md-2">
            @Html.LabelFor(model => model.seniority)
    </div>
    <div class="col-md-3">
            @Model.seniority
    </div>
    </div>

Upvotes: 1

Related Questions