[英]How to vertically align text in a @Html.TextAreaFor
如何在@ Html.TextAreaFor中垂直居中放置文本?
這是HTML
<table class="width100percent padding0Margin0">
<tr class="height35">
<td class="width150">
Description
</td>
<td class="textValignMiddle">
@Html.TextAreaFor(m => m.Job.Description, new { @class = "width646 height25", @placeholder = "Enter " + @Model.GetNameJob + " description" })
</td>
</tr>
</table>
我已經嘗試跟隨CSS,但是我沒有什么需要
.textBottom{vertical-align: text-bottom;}
.textTop{vertical-align:text-top;}
.textVerticalAlignTop{vertical-align:top;}
.textBaseLine{vertical-align:baseline; }
.textValignBottom{vertical-align:bottom;}
.textValignMiddle {vertical-align: middle;}
這樣做的唯一方法是添加padding-top然后縮小文本框的大小嗎?
請關注此CSS ...
.textValignMiddle
{
vertical-align:middle;
display: table-cell;
float: none;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.