Lamloumi Afif Lamloumi Afif - 6 months ago 29
HTML Question

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 ?

Answer

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>
Comments