Lamloumi Afif
Lamloumi Afif

Reputation: 9081

Vertical alignement within razor view

I have this snippet :

<p>
@Html.LabelFor(m => m.address, new { style="vertical-align: middle;" }) @Html.TextAreaFor(m => m.address, new { @class = "addition ", value = "",rows="4", required = "required" })
 </p>

I get this result :

result

I need to put the label in the middle. How can I change the code above to accomplish this task ?

Upvotes: 0

Views: 866

Answers (1)

jsDevia
jsDevia

Reputation: 1292

add vertical-align:middle to text area too.

    <p>
           @Html.LabelFor(m => m.Address, new { style = "vertical-align: middle;" })
           @Html.TextAreaFor(m => m.Address, new { @class = "addition ", style = "vertical-align: middle;", value = "", rows = "4", required = "required" })
    </p>

Upvotes: 2

Related Questions